🚀(nginx) improve nginx configuration

This commit is contained in:
Sylvain Zimmer
2025-04-19 20:01:32 +02:00
parent f83422ad3b
commit b35fc2dcd1
+17 -17
View File
@@ -14,23 +14,6 @@ server {
error_page 404 /404.html;
location /mailbox/ {
error_page 404 /mailbox/[mailboxId].html;
}
location /mailbox/([^/]+)/thread/ {
error_page 404 /mailbox/[mailboxId]/thread/[threadId].html;
}
# Frontend export
location / {
try_files $uri index.html $uri/ =404;
}
location = /404.html {
internal;
}
# Django rest framework
location ^~ /api/ {
proxy_set_header X-Forwarded-Proto https;
@@ -51,4 +34,21 @@ server {
proxy_pass http://backend_server;
}
# Next static export
location ~* ^/mailbox/[^/]+$ {
try_files /mailbox/[mailboxId].html =404;
}
location ~* ^/mailbox/[^/]+/thread/[^/]+$ {
try_files /mailbox/[mailboxId]/thread/[threadId].html =404;
}
location = /404.html {
internal;
}
# Frontend export
location / {
try_files $uri index.html $uri/ =404;
}
}