nginx配置如下
这样就可以通过域名或IP直接访问WGCLOUD页面了,不用再加后面的/wgcloud了
注意把localhost改为自己的实际server主机IP
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://localhost:9999/wgcloud/login/toLogin; proxy_cookie_path /wgcloud/ /; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_intercept_errors on; } location /wgcloud/ { proxy_pass http://localhost:9999/wgcloud/; proxy_cookie_path /wgcloud/ /; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
修改完nginx配置后,重启下nginx
root@vultr:/etc/nginx# /usr/sbin/nginx -s reload
标签:set,header,URL,nginx,html,proxy,wgcloud From: https://www.cnblogs.com/wanghouhou/p/16809760.html