server {
            listen 80;
            server_name rg1008.com www.rg1008.com; 
            rewrite ^(.*)$   https://$host$1 permanent;
}

server {
     listen 443 ssl; 
     #填写绑定证书的域名
     server_name rg1008.com www.rg1008.com; 
     #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
     root C:/rg1008.com;
     #证书文件名称
     ssl_certificate 1_www.rg1008.com_bundle.crt; 
     #私钥文件名称
     ssl_certificate_key 2_www.rg1008.com.key; 
     ssl_session_timeout 5m;
     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
     ssl_prefer_server_ciphers on;
     #文件上传403错误大小限制
     client_max_body_size    4m;

     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