nginx多站路由配置tomcat

快樂就好發表於2018-10-09

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;
}

相關文章