webpage localhost不能加载

进行本机发布成ip地址进行验证调试

前端使用nginx代理

  server {
        listen   9963;
        server_name localhost

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

        #underscores_in_headers on;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        root C:/0_RG/Code/rg3-cli/dist-pro/bt;


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

# 阻止特定文件访问
location ~* /.bat {
  deny all;
}

         location / {
# 解决微信缓存页面配置
  autoindex on;
  add_header Cache-Control "no-store";
  expires -1;
  # 解决微信缓存页面配置 end
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:5900/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:5900/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:5900/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:5900/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:5900/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:5900/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;
        }
    }

后端debug运行

{
  "server.urls": "http://*:5900;http://*:5901",
  "Kestrel": {
    "Enabled": false,
    "Limits": {
      "MaxConcurrentConnections": 100,
      "MaxConcurrentUpgradedConnections": 100
    },
    "DisableStringReuse": true
  }
}

如果后端运行,还是报错,直接运行bin文件

C:\\0_RG\\Code\\rg3-pf\\RG3.Web.Host.BT\\bin\\Debug\\netcoreapp3.1

文档更新时间: 2021-07-06 08:00   作者:admin