首页 新闻 会员 周边 捐助

SignalR加了Token验证之后 .NetCore WebApi Nginx 反向代理 无法获取到链接SignalRId 和 Token信息,前端开发环境用Vue本地代理调试没有问题各位大佬求指点一下有遇到过的!

0
悬赏园豆:30 [待解决问题]


这是客户端发起的请求

这里是SignalR集线器中的代码 客户端请求链接之后我的Console.Out.WriteLineAsync打印都没有走

这里是加Token添加到SignalR的集线器中

以下是Nginx配置的conf文件:

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;

# dotnet core API
upstream dotnetblogserver1 {
        server 127.0.0.1:5000;
}


server {
    listen       8561;
    server_name  coreapi.uwladmin.club;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
    root   html;

        proxy_pass   http://localhost:5000;

        index  index.html index.htm;
    }

    #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;
    }


}

#vue admin  listen  uwladmin.club
server {
    listen       8562;
    server_name  www.uwladmin.club;
    location / {
        #rewrite .* /index.html break;  
        root   C:\WebSite\UwlAdmin\dist;
        index  index.html index.htm;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    location /api/ {
        rewrite  ^.+apb/?(.*)$ /$1 break;
        #include  uwsgi_params;
        proxy_pass http://localhost:8561;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    location /api2/ {
        include  uwsgi_params;
        proxy_pass http://localhost:8561;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

}

九两白菜粥的主页 九两白菜粥 | 初学一级 | 园豆:122
提问于:2019-11-15 09:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册