IT干货网

nginx多站路由配置tomcat

shasha 2022年03月15日 编程设计 185 0

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


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!