Skip to content

Commit 333ccdc

Browse files
committed
fix pre-rendered SPAs
1 parent 195a6af commit 333ccdc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

nginx.conf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
server {
2-
listen 80;
3-
server_name localhost;
2+
listen 80 default_server;
43

54
gzip on;
65
gzip_min_length 1000;
@@ -13,14 +12,14 @@ server {
1312
# e.g. /, /user and /foo/bar will return index.html
1413
location / {
1514
add_header Cache-Control "no-store";
16-
try_files $uri $uri/ /index.html;
15+
try_files $uri $uri/index.html /index.html;
1716
}
1817

1918
# files
2019
# for all routes matching a dot, check for files and return 404 if not found
2120
# e.g. /file.js returns a 404 if not found
2221
location ~ \.(?!html) {
2322
add_header Cache-Control "public, max-age=2678400";
24-
try_files $uri $uri/ =404;
23+
try_files $uri =404;
2524
}
2625
}

0 commit comments

Comments
 (0)