Skip to content

Commit 989178d

Browse files
committed
fix: corrigir nginx.conf para Docusaurus
- Move regex de cache para dentro do location / - Isso resolve conflito que causava 404 em assets estáticos - Configuração baseada no archbase-app-documentation testado
1 parent d0c25c4 commit 989178d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

deployment/docs/nginx.conf

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ server {
1010
gzip_min_length 1024;
1111
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json application/javascript application/xml image/svg+xml;
1212

13-
# Docusaurus static export
14-
location / {
15-
try_files $uri $uri/ $uri/index.html /index.html;
16-
}
17-
18-
# Cache static assets
19-
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|webp)$ {
20-
expires 1y;
21-
add_header Cache-Control "public, immutable";
22-
}
23-
2413
# Security headers
2514
add_header X-Frame-Options "SAMEORIGIN" always;
2615
add_header X-Content-Type-Options "nosniff" always;
2716
add_header X-XSS-Protection "1; mode=block" always;
17+
18+
# Docusaurus static export - serve arquivos existentes primeiro
19+
location / {
20+
try_files $uri $uri/ $uri/index.html /index.html;
21+
# Cache para arquivos estáticos que existem
22+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|webp|json)$ {
23+
expires 1y;
24+
add_header Cache-Control "public, immutable";
25+
}
26+
}
2827
}

0 commit comments

Comments
 (0)