首页 > 系统相关 >nginx配置访问WGCLOUD页面URL地址不加后缀/wgcloud

nginx配置访问WGCLOUD页面URL地址不加后缀/wgcloud

时间:2022-10-20 14:35:24浏览次数:37  
标签:set header URL nginx html proxy wgcloud

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

相关文章

  • nginx系列之一:nginx入门
    nginx系列之一:nginx入门@目录nginx系列之一:nginx入门前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结前言nginx系列之一:nginx入门nginx系列之二:配置文件解读......
  • Nginx 在windows下的安装及使用(负载均衡 多服务器配置)
    1.下载nginxhttp://nginx.org/en/download.html下载稳定版本,以nginx/Windows-1.12.2为例,直接下载nginx-1.12.2.zip下载后解压,解压后如下  2.启动nginx有很多种方......
  • Nginx 解决跨域请求
    一遇到到下这种问题,大家是不是很头疼,没错,这就是跨域问题,首先我们先说一下什么是跨域?为什么会跨域?什么问题造成的?  跨域简单来说,就是浏览器url地址和访问数据接口的地......
  • Nginx 在Windows下配置证书
    1、从证书出售商获取证书文件,并复制到nginx的conf目录下2、打开nginx.conf配置文件,写入以下代码server{listen443ssl;......
  • nginx做负载均衡服务器,配置动静分离
    nginx做负载均衡服务器,配置动静分离目录nginx做负载均衡服务器,配置动静分离部署LNMP源码安装nginx二进制安装mysql源码安装php配置nginx部署LAMP源码安装httpd二进制安装......
  • nginx负载均衡读写分离
    目录nginx负载均衡读写分离nginx主机:源码部署nginxlnmp主机http主机测试动静分离nginx负载均衡读写分离环境说明主机名IP地址服务系统nginx192.168.34.13......
  • nginx 上传文件报错 413 (Request Entity Too Large)
     最近开发时遇到了上传失败的情况,提示:413RequestEntityTooLarge(请求实体太大)因为上传通过代理服务器Nginx,因此可以修改代理服务器Nginx的相关配置来解决。作为......
  • nginx violates the following Content Security Policy directive: "default-src 'se
    violatesthefollowingContentSecurityPolicydirective:"default-src'self'". Nginx解决内容安全策略CSP(Content-Security-Policy)配置方式(漏洞修复)-龙凌云端-......
  • nginx+vite 项目打包及部署到服务器二级路由
    项目打包及部署到服务器二级路由例如:我希望将打包的项目部署到http://localhost:8088/web/上一.项目配置及打包项目部署到服务器二级路由需要配置基础路径base,即需要......
  • WGCLOUD 可以监测哪些数据库?
    主流的数据库都支持,如MySQL,Oracle,PostgreSQL,SQLServer,MariaDB等......