Skip to content

Commit 9154e1a

Browse files
committed
Updates the Nginx location block to work properly when we set MAIN_PAGE in the production context to serve at /signals/static/....
This uses a regex to match on anyting that comes before `/static`, and then capture anything after into `$1` so that we can pass that as a file path to properly load the static files. Previously this only worked when we were server at the bare URL, but now it works when we are serving at `/signals/` (or potentially other URL "prefixes") as well.
1 parent 1f38766 commit 9154e1a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nginx/default.conf.template

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
server {
22
listen 80;
33
server_name sdnginx;
4-
5-
location /static/ {
4+
location ~* /static/(.*)$ {
65
autoindex on;
7-
alias /staticfiles/;
6+
alias /staticfiles/$1;
87
}
98

109
location / {

0 commit comments

Comments
 (0)