airikr 修订了这个 Gist . 跳至此修订
没有变更
airikr 修订了这个 Gist . 跳至此修订
1 file changed, 2 insertions, 2 deletions
domain.conf
@@ -14,8 +14,8 @@ Protocols h2 h2c http/1.1 | |||
14 | 14 | ||
15 | 15 | ProxyRequests Off | |
16 | 16 | ProxyPreserveHost On | |
17 | - | ProxyPass / http://127.0.0.1:4439/ upgrade=websocket | |
18 | - | ProxyPassReverse / http://127.0.0.1:4439/ | |
17 | + | ProxyPass / http://127.0.0.1:8443/ upgrade=websocket | |
18 | + | ProxyPassReverse / http://127.0.0.1:8443/ | |
19 | 19 | ||
20 | 20 | RewriteEngine On | |
21 | 21 | # RewriteCond ${HTTP:Upgrade} websocket [NC] |
airikr 修订了这个 Gist . 跳至此修订
1 file changed, 33 insertions
domain.conf(file created)
@@ -0,0 +1,33 @@ | |||
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:4439/ upgrade=websocket | |
18 | + | ProxyPassReverse / http://127.0.0.1:4439/ | |
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> |