Last active 1747695738

My default config file for a domain for Apache (Docker).

Revision a1aa8c7a8be84d8c7f071683b6d8a5bdd4711b7e

domain.conf Raw
1Protocols 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>