0
votes

I am trying to deploy an ASP.net Core 3.1 app to a server with apache2 installed. I have created the following virtualhost:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ProxyPreserveHost On
    ProxyPass / https://127.0.0.1:5001/
    ProxyPassReverse / https://127.0.0.1:5001/
    #ServerAdmin [email protected]
    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>

when i run the application (using dotnet .dll), i get the following message:

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.

Then when i try to browse the app I get the following error:

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.

When I view the logs the only thing that I find is:

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.

I have tried to enable the mods proxy_http, http and it didn't fix the issue.

Thanks in advance!

1

1 Answers

0
votes

The issue was that the virtual host needed these two lines at the start:

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

and these lines at the virtualhost *443:

SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off