Skip to content

Commit e0b54b4

Browse files
committed
fixed /admin redirection and /static proxy_pass
1 parent fa1b13d commit e0b54b4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/frontend/nginx/nginx.conf.template

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,27 @@ server {
1919
}
2020

2121
# Django admin
22-
location ^~ ^/${DJANGO_ADMIN_URL}/ {
22+
location /${DJANGO_ADMIN_URL} {
23+
return 301 https://$host/${DJANGO_ADMIN_URL}/;
24+
}
25+
26+
location ^~ /${DJANGO_ADMIN_URL}/ {
2327
proxy_set_header X-Forwarded-Proto https;
2428
proxy_set_header Host $http_host;
2529
proxy_set_header X-Forwarded-For $remote_addr;
2630
proxy_redirect off;
2731
proxy_pass http://backend_server;
2832
}
2933

34+
# Django statics
35+
location ^~ /static/ {
36+
proxy_set_header X-Forwarded-Proto https;
37+
proxy_set_header Host $http_host;
38+
proxy_set_header X-Forwarded-For $remote_addr;
39+
proxy_redirect off;
40+
proxy_pass http://backend_server;
41+
}
42+
3043
# Next static export
3144
location ~* ^/mailbox/[^/]+$ {
3245
try_files /mailbox/[mailboxId].html =404;

0 commit comments

Comments
 (0)