Skip to content

Commit a00f352

Browse files
committed
added example apache configuration file
1 parent b7857a8 commit a00f352

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ The first deploy might take a while, but after that your `node_modules` dir shou
259259
260260
## Deployment on your server with PM2 (optional)
261261
1. Install PM2 `npm install pm2@latest -g`
262-
2. Run `sh deploylment/deploy.sh`
262+
2. Run `sh deploylment/deploy.sh` (please check deploy.sh for comments)
263263
264264
## FAQ
265265

deployment/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
npm install
88
npm run build
99

10+
# run this only when pm2 is running. Otherwise, should run pm2 start deployment/www.json
1011
pm2 reload deployment/www.json
1112

1213
# after the build, clean up the dist files that are older than 2 days

example_apache.config

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

Comments
 (0)