首页 > 解决方案 > ASP.NET CORE 3.0 Identity 在 Ubuntu 19.04 上不起作用

问题描述

我正在使用部署到 Ubuntu 19.04 的 ASP.NET Core 3.0 应用程序上的标识集。

身份区域似乎无法正常工作。当我导航到它时,它给了我一个来自 Nginx 的“未找到”。我试图弄清楚我需要改变什么来让 Nginx 允许身份区域(和其他区域)通过反向代理。当我 curl localhost:5000/Identity/Account/Register 时,我收到 HTML。

Nginx 设置:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/jl3/linux-x64/publish/;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {


        proxy_pass http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }
    location /css/ {
        root /var/www/jl3/linux-x64/publish/wwwroot;
    }
    location /images/ {
        root /var/www/jl3/linux-x64/publish/wwwroot;
    }
    location /js/ {
        root /var/www/jl3/linux-x64/publish/wwwroot;
    }
    location /lib/ {
        root /var/www/jl3/linux-x64/publish/wwwroot;
    }

}

我是否缺少位置参考,或者我的根命令不正确?主(不是身份)页面工作正常,但对于其他一些页面,我必须包含 Hrefs 而不是使用 asp-controller 和 asp-action 帮助器标签。

标签: c#nginxasp.net-core

解决方案


推荐阅读