不加/wgcloud访问WGCLOUD页面如何配置

2022-10-19  本文已影响0人  佳妮1992

使用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
上一篇下一篇

猜你喜欢

热点阅读