From b35fc2dcd1a55841c85a366bbb23edc7a2287d1a Mon Sep 17 00:00:00 2001 From: Sylvain Zimmer Date: Thu, 17 Apr 2025 20:52:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80(nginx)=20improve=20nginx=20configu?= =?UTF-8?q?ration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nginx/servers.conf.erb | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/nginx/servers.conf.erb b/src/nginx/servers.conf.erb index 35bdd4e9..9846529d 100644 --- a/src/nginx/servers.conf.erb +++ b/src/nginx/servers.conf.erb @@ -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; + } + } \ No newline at end of file