Last active
January 13, 2025 08:17
-
-
Save nzvtrk/d9cfa2eb5de7ed3c9b39c00967199c72 to your computer and use it in GitHub Desktop.
Nginx prerender-spa config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root /usr/share/nginx/html; | |
# default spa conf | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
# regexp, including page folders/paths | |
set $pages "faq|about|choice|gift|feedback|payment|oneplusone"; | |
# send index from appropriate folder | |
location ~ ^/($pages)$ { | |
index /usr/share/nginx/html/$1/index.html; | |
} | |
# send static from root folder | |
location ^~ ($pages) { | |
alias /usr/share/nginx/html/; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment