将Tomcat / Jenkins URL重定向到root

时间:2014-09-13 00:34:45

标签: tomcat nginx jenkins proxy rewrite

我在端口8080上运行tomcat,并且部署了Jenkins并在Tomcat之上运行。所以我的Jenkins网址是:http://myserver.com:8080/jenkins

我正在寻找一种方法来配置我的Nginx,当我请求http://myserver.com时,它会响应http://myserver.com:8080/jenkins的内容,但不会更改网址。简而言之:

http://myserver.com === http://myserver.com:8080/jenkins

我当前的Nginx配置但不是我想要的:

worker_processes 1;

events {
    worker_connections  1024;
}

http {
    server {
        listen 80;
        server_name localhost;

        location /jenkins {
            proxy_pass http://127.0.0.1:8080/jenkins/;
        }

        location / {
            rewrite ^/$ /jenkins last;
        }
    }
}

谢谢!

0 个答案:

没有答案