server {
        listen   80;
        server_name rg1008.com www.rg1008.com;

        #文件上传403错误大小限制
        client_max_body_size    4m;

        #underscores_in_headers on;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        root C:/rg1008.com;


         #将http强制转https
       # location / {
         # rewrite (.*) https://www.rg1008.com$1 permanent; 
        # }




         location / {
add_header Access-Control-Allow-Origin *;
            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
            add_header Access-Control-Allow-Methods "GET, POST, OPTIONS,PUT,DELETE";
            try_files $uri $uri/ @router;
            index  index.html index.htm;

         }

        location /ws/api/v3/ {
    proxy_pass http://localhost:5500/ws/api/v3/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        # 转发websocket需要的设置
         proxy_connect_timeout 4s;                #配置点1
                 proxy_read_timeout 60s;                  #配置点2,如果没效,可以考虑这个时间配置长一点
                 proxy_send_timeout 12s;                  #配置点3
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        }
         location /plugins/ {
           proxy_pass http://localhost:8800/plugins/;
        proxy_set_header Host $host;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         }
           location /bo/api/v1/file/upload/ {
            proxy_pass http://localhost:5500/bo/api/v1/file/upload/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_method POST;
        #proxy_set_header Content-Type multipart/form-data;
            }
          location /bo/api/v1/auth/ {
            proxy_pass http://localhost:5500/bo/api/v1/auth/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
           location /filelibary/ {
            proxy_pass http://localhost:5500/filelibary/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

       location /bs/api/ {
            proxy_pass http://localhost:5500/bs/api/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
       location /bo/api/ {
            proxy_pass http://localhost:5500/bo/api/;
        proxy_set_header Host $host;
        proxy_set_header XsysId $http_XsysId;
        proxy_set_header XverifyApi $http_XverifyApi;
        proxy_set_header XuserId $http_XuserId;
        proxy_set_header Authorization $http_Authorization;
        proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
        proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
        proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        location @router {
            rewrite ^.*$ /index.html last;
        }
    }
文档更新时间: 2021-06-26 08:00   作者:admin