-
-
Save Shillos/a90f11a5ab262d64a304765626899062 to your computer and use it in GitHub Desktop.
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
<VirtualHost *:80> | |
ServerName kiwiirc.example.com | |
ServerAdmin webmaster@example.com | |
# Kiwi IRC client files are located here | |
DocumentRoot /usr/share/kiwiirc | |
DirectoryIndex index.html | |
# Reverse proxy websocket connections | |
# requires: a2enmod rewrite proxy proxy_wstunnel | |
RewriteEngine On | |
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] | |
RewriteRule .* ws://localhost:7778%{REQUEST_URI} [P,QSA,L] | |
# Reverse proxy http connections | |
# requires: a2enmod proxy proxy_http | |
ProxyVia On | |
ProxyRequests Off | |
ProxyPass /webirc/ http://localhost:7778/webirc/ | |
ProxyPassReverse /webirc/ http://localhost:7778/webirc/ | |
ProxyPreserveHost on | |
# send all connections to https (can remove above rewrite/proxy rules) | |
# RewriteCond %{SERVER_NAME} =kiwiirc.example.com | |
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName kiwiirc.example.com | |
ServerAdmin webmaster@example.com | |
# Kiwi IRC client files are located here | |
DocumentRoot /usr/share/kiwiirc | |
DirectoryIndex index.html | |
# SSL config | |
# requires: a2enmod ssl | |
SSLEngine on | |
# Reverse proxy websocket connections | |
# requires: a2enmod rewrite proxy proxy_wstunnel | |
RewriteEngine On | |
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC] | |
RewriteRule .* ws://localhost:7778%{REQUEST_URI} [P,QSA,L] | |
# Reverse proxy http connections | |
# requires: a2enmod proxy proxy_http | |
ProxyVia On | |
ProxyRequests Off | |
ProxyPass /webirc/ http://localhost:7778/webirc/ | |
ProxyPassReverse /webirc/ http://localhost:7778/webirc/ | |
ProxyPreserveHost on | |
# Letsencrypt certificates | |
SSLCertificateFile /etc/letsencrypt/live/kiwiirc.example.com/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/kiwiirc.example.com/privkey.pem | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment