【问题标题】:asp.net core apache Internal Server Errorasp.net core apache内部服务器错误
【发布时间】:2020-09-26 17:29:57
【问题描述】:

我正在尝试将 ASP.net Core 3.1 应用程序部署到安装了 apache2 的服务器。我创建了以下虚拟主机:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ProxyPreserveHost On
    ProxyPass / https://127.0.0.1:5001/
    ProxyPassReverse / https://127.0.0.1:5001/
    #ServerAdmin mail@mail.com
    ServerName xx.app
    ServerAlias www.xx.app
    ErrorLog ${APACHE_LOG_DIR}xx-error.log
    CustomLog ${APACHE_LOG_DIR}xx-access.log common


SSLCertificateFile /etc/letsencrypt/live/xx.app/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/xx.app/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

当我运行应用程序(使用 dotnet .dll)时,我收到以下消息:

Hosting environment: Production
Content root path: /home/cv/web/publish
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.

然后当我尝试浏览应用程序时,我收到以下错误:

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.

当我查看日志时,我唯一发现的是:

AH01144: No protocol handler was valid for the URL / (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

我尝试启用 mods proxy_http、http 并没有解决问题。

提前致谢!

【问题讨论】:

    标签: asp.net apache asp.net-core internal-server-error


    【解决方案1】:

    问题是虚拟主机在开始时需要这两行:

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    

    虚拟主机 *443 上的这些行:

    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    

    【讨论】:

      猜你喜欢
      • 2017-03-07
      • 1970-01-01
      • 2017-12-08
      • 2018-08-03
      • 2017-08-25
      • 1970-01-01
      • 2018-02-22
      • 2018-01-08
      • 2015-02-12
      相关资源
      最近更新 更多