31 lines
956 B
Plaintext
31 lines
956 B
Plaintext
# ============================================================================
|
|
# AVANZATO - Configuracao Nginx para Docker
|
|
# ============================================================================
|
|
# Coloque este arquivo em: /etc/nginx/conf.d/default.conf
|
|
# dentro do container Docker
|
|
# ============================================================================
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# === CORRECAO CRITICA: SPA React ===
|
|
# Redireciona TODAS as rotas para index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Cache para assets estaticos
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
|
|
expires 6M;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Seguranca
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
}
|