nginx 多个 root页面配置
server {
listen 80;
server_name 192.168.5.205;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /home/alidata/java_test/comvee_dz/web-front/;
index login/login.html;
}
location /admin {
alias /home/alidata/java_test/comvee_dz/web-admin/;
index login.html;
try_files $uri $uri/ /index.html;
}
}
反向代理
server {
listen 80;
server_name 192.168.1.125;
location / {
root D:/IdeaProjects/nanan/comvee_nanan/trunk/web-front/;
index login/login.html;
}
location /hxyy/ {
proxy_pass http://localhost:8080/hxyy/;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# websocket 代理
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}