domain.conf
· 970 B · Text
Bruto
Protocols h2 h2c http/1.1
<VirtualHost *:80>
ServerName domain.com
RewriteEngine On
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin email@domain.com
ServerName domain.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8443/ upgrade=websocket
ProxyPassReverse / http://127.0.0.1:8443/
RewriteEngine On
# RewriteCond ${HTTP:Upgrade} websocket [NC]
# RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteCond %{SERVER_NAME} !=domain.com
# RewriteRule ^/?(.*) "ws://localhost:4439/$1" [P,L]
RewriteRule ^ - [F]
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
</VirtualHost>
| 1 | Protocols h2 h2c http/1.1 |
| 2 | |
| 3 | <VirtualHost *:80> |
| 4 | ServerName domain.com |
| 5 | |
| 6 | RewriteEngine On |
| 7 | RewriteCond %{SERVER_NAME} =domain.com |
| 8 | RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] |
| 9 | </VirtualHost> |
| 10 | |
| 11 | <VirtualHost *:443> |
| 12 | ServerAdmin email@domain.com |
| 13 | ServerName domain.com |
| 14 | |
| 15 | ProxyRequests Off |
| 16 | ProxyPreserveHost On |
| 17 | ProxyPass / http://127.0.0.1:8443/ upgrade=websocket |
| 18 | ProxyPassReverse / http://127.0.0.1:8443/ |
| 19 | |
| 20 | RewriteEngine On |
| 21 | # RewriteCond ${HTTP:Upgrade} websocket [NC] |
| 22 | # RewriteCond ${HTTP:Connection} upgrade [NC] |
| 23 | RewriteCond %{SERVER_NAME} !=domain.com |
| 24 | # RewriteRule ^/?(.*) "ws://localhost:4439/$1" [P,L] |
| 25 | RewriteRule ^ - [F] |
| 26 | |
| 27 | RequestHeader set X-Forwarded-Proto https |
| 28 | RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s |
| 29 | |
| 30 | Include /etc/letsencrypt/options-ssl-apache.conf |
| 31 | SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem |
| 32 | SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem |
| 33 | </VirtualHost> |