Created
July 23, 2020 13:33
-
-
Save technoknol/f21ae396f463e78e431bd89cc41b83ee to your computer and use it in GitHub Desktop.
.NET core app with SignalR with SSL with Apache Reverse Proxy Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
RewriteEngine On | |
ProxyPreserveHost On | |
ProxyRequests Off | |
# allow for upgrading to websockets | |
RewriteEngine On | |
RewriteCond %{HTTP:Upgrade} =websocket [NC] | |
RewriteRule /(.*) ws://localhost:5000/$1 [P,L] | |
RewriteCond %{HTTP:Upgrade} !=websocket [NC] | |
RewriteRule /(.*) http://localhost:5000/$1 [P,L] | |
ProxyPass "/" "http://localhost:5000/" | |
ProxyPassReverse "/" "http://localhost:5000/" | |
ProxyPass "/chatHub" "ws://localhost:5000/chatHub" | |
ProxyPassReverse "/chatHub" "ws://localhost:5000/chatHub" | |
ServerName site.com | |
SSLCertificateFile /etc/letsencrypt/live/site.com/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/site.com/privkey.pem | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment