我按照官方指南在Ubuntu 18.04上安装了NET Core SDK:
https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install
我用命令C#
创建了一个Hello World
dotnet new razor
项目,并用dotnet publish
发布。
我在Plesk中用子域配置了一个新域。
我在https://docs.microsoft.com/it-it/aspnet/core/host-and-deploy/linux-apache?view=aspnetcore-2.2下在Plesk中配置(使用官方参考:Apache & nginx Settings
,并带有以下示例:
HTTP / HTTPS的其他指令:
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ServerName sub.mydomain.com
ServerAlias *.mydomain.com
ErrorLog ${APACHE_LOG_DIR}helloapp-error.log
CustomLog ${APACHE_LOG_DIR}helloapp-access.log common
我将发布的项目移到子域文件夹下,并使用命令dotnet myproject.dll
启动它
我收到以下输出:
Hosting environment: Production
Content root path: /var/www/vhosts/mydomain.com/sub.mydomain.com
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
在浏览器中打开sub.mydomain.com
,我收到以下错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at logx.edotto.com Port 80
在子域日志中,我只能看到此内容:
有人可以提示我去哪里解决此错误吗?
我可以检查一些内容以接收有关该错误的更多详细信息吗?
首先您需要临时禁用Nginx