nginx多站路由配置tomcat

server {
listen 80;
server_name 1.goal.cn;
index index index.html index.htm index.jsp;
root /www/server/tomcat/1/ROOT/;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
access_log /www/wwwlogs/1.access.log;
}

server {
listen 80;
server_name 2.goal.cn;
index index index.html index.htm index.jsp;
root /www/server/tomcat/2/ROOT/;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
access_log /www/wwwlogs/2.access.log;
}

posted @ 2018-10-09 14:57  快乐就好  阅读(532)  评论(0编辑  收藏  举报