File tree 1 file changed +27
-14
lines changed
examples/web-server/apache 1 file changed +27
-14
lines changed Original file line number Diff line number Diff line change 14
14
sudo apt install apache2
15
15
```
16
16
17
- 4 . Stop Apache service and disable default site:
17
+ 4 . Enable the following Apache modules:
18
+
19
+ ``` console
20
+ sudo a2enmod proxy
21
+ sudo a2enmod proxy_http
22
+ sudo a2enmod ssl
23
+ sudo a2enmod rewrite
24
+ ```
25
+
26
+ 5 . Stop Apache service and disable default site:
18
27
19
28
``` console
20
29
sudo a2dissite 000-default.conf
65
74
66
75
``` apache
67
76
<VirtualHost *:443>
68
- ServerName YOUR_SUBDOMAIN
69
- ServerAlias *.YOUR_SUBDOMAIN
70
- ErrorLog ${APACHE_LOG_DIR}/error.log
71
- CustomLog ${APACHE_LOG_DIR}/access.log combined
72
-
73
- ProxyPass / http://127.0.0.1:3000/
74
- ProxyPassReverse / http://127.0.0.1:3000/
75
- ProxyRequests Off
76
- ProxyPreserveHost On
77
-
78
- # SSL configuration
79
- SSLCertificateFile /etc/letsencrypt/live/YOUR_SUBDOMAIN/fullchain.pem
80
- SSLCertificateKeyFile /etc/letsencrypt/live/YOUR_SUBDOMAIN/privkey.pem
77
+ ServerName dev.dietstyler.com
78
+ ServerAlias *.dev.dietstyler.com
79
+ ErrorLog ${APACHE_LOG_DIR}/error.log
80
+ CustomLog ${APACHE_LOG_DIR}/access.log combined
81
+
82
+ ProxyPass / http://127.0.0.1:3000/
83
+ ProxyPassReverse / http://127.0.0.1:3000/
84
+ ProxyRequests Off
85
+ ProxyPreserveHost On
86
+
87
+ RewriteEngine On
88
+ RewriteCond %{HTTP:Connection} Upgrade [NC]
89
+ RewriteCond %{HTTP:Upgrade} websocket [NC]
90
+ RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
91
+
92
+ SSLCertificateFile /etc/letsencrypt/live/dev.dietstyler.com/fullchain.pem
93
+ SSLCertificateKeyFile /etc/letsencrypt/live/dev.dietstyler.com/privkey.pem
81
94
</VirtualHost>
82
95
```
83
96
You can’t perform that action at this time.
0 commit comments