【发布时间】:2017-09-15 23:00:53
【问题描述】:
我试图找出这个错误一周,但我仍然找不到错误。
我目前运行的系统是 Linux Ubuntu 16.04
我已在 launchSettings.json 中将所有内容设置为生产
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:51754/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
},
"FilmerCore": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
},
"applicationUrl": "http://localhost:51755"
}
}
}
这是我的 web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\FilmerCore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
<!--ProjectGuid: 5be3ea4c-66c2-42b0-8583-29c6bf415674-->
另外,我使用 nginx 作为反向代理。主要配置是这样的
[Unit]
Description=Filmer - .NET movie platform
[Service]
WorkingDirectory=/var/aspnetcore/filmer
ExecStart=/usr/bin/dotnet /var/aspnetcore/filmer/FilmerCore.dll
Restart=always
RestartSec=10 # Restart service after 10 seconds if dotnet service crashes
SyslogIdentifier=filmer
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Development
[Install]
WantedBy=multi-user.target
【问题讨论】:
标签: asp.net linux nginx asp.net-core asp.net-core-mvc