-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathexample_apache.config
44 lines (40 loc) · 1.3 KB
/
example_apache.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<IfModule mod_ssl.c>
<VirtualHost *:443>
RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost On
ServerName shopecific.com
Alias /static /var/www/shopecific/static
<Directory /var/www/shopecific/static>
Options FollowSymLinks
</Directory>
Header always unset X-Frame-Options
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteCond %{REQUEST_URI} !/static/
RewriteRule /(.*) http://localhost:8080/$1 [P,L]
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/shopecific.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/shopecific.com/privkey.pem
ErrorDocument 404 /static/errors/
ErrorDocument 500 /static/errors/
ErrorDocument 502 /static/errors/
ErrorDocument 503 /static/errors/
ErrorDocument 504 /static/errors/
</VirtualHost>
</IfModule>
#redirect http to https
<VirtualHost *:80>
ServerName shopecific.com
ServerAlias www www.shopecific.com
Redirect "/" "https://shopecific.com/"
</VirtualHost>
#redirect www to non-www
<VirtualHost *:443>
ServerName www.shopecific.com
Redirect "/" "https://shopecific.com/"
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/shopecific.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/shopecific.com/privkey.pem
</VirtualHost>