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