fix(nginx): add SPA routing and security headers
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
trigger: always_on
|
||||||
|
---
|
||||||
|
|
||||||
|
# GEMINI.md - Antigravity Kit (Auto-Generated)
|
||||||
|
|
||||||
|
|
||||||
|
## TIER 0: UNIVERSAL RULES (Always Active)
|
||||||
|
|
||||||
|
### 🌍 Global User Rules (MANDATORY)
|
||||||
|
|
||||||
|
1. **Idioma**: Conversar e desenvolver sempre em **Português do Brasil**.
|
||||||
|
2. **Automação Terminais**: Executar comandos de terminal, leitura de arquivos e edições de forma automática. Comandos de desenvolvimento (build, install, lint, git, etc.) são sempre 'SafeToAutoRun'.
|
||||||
|
3. **Memória & Monitoramento**: Após cada evolução ou atualização no app, é OBRIGATÓRIO:
|
||||||
|
- Atualizar a memória do app em '/root/Antigravity_Memory/knowledge/{AppName}.md'.
|
||||||
|
- Atualizar o status e credenciais no 'app.py' do Cronos Dashboard.
|
||||||
|
- Realizar 'git commit', 'git push' e executar o 'update.sh' do Cronos para deploy automático.
|
||||||
|
|
||||||
|
### 🌐 Language Handling
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
@@ -17,6 +17,7 @@ FROM nginx:alpine
|
|||||||
RUN apk update && apk upgrade --no-cache
|
RUN apk update && apk upgrade --no-cache
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
# Nginx default listen 80
|
# Nginx default listen 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
# Security Headers
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||||
|
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline';" always;
|
||||||
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache static assets
|
||||||
|
location ~* \.(?:css|js|jpg|svg)$ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache index.html (no cache to prevent stale data)
|
||||||
|
location = /index.html {
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user