mirror of
https://github.com/suitenumerique/messages.git
synced 2026-09-28 12:45:00 +02:00
🚀(nginx) improve nginx configuration
This commit is contained in:
+17
-17
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user