[Auto-Sync] Atualização das configurações em srvproxy001.itguys.com.br - 2025-11-05 21:40:41
This commit is contained in:
parent
3b7dd40e86
commit
3c91e1c822
|
|
@ -23,15 +23,12 @@ server {
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
} # managed by Certbot
|
} # managed by Certbot
|
||||||
|
|
||||||
|
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
server_name vcenter.itguys.com.br;
|
server_name vcenter.itguys.com.br;
|
||||||
|
|
||||||
# Força o uso de HTTPS com um redirecionamento 301 (permanente)
|
# Força o uso de HTTPS com um redirecionamento 301 (permanente)
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Servidor principal que lida com o tráfego HTTPS (Porta 443)
|
# Servidor principal que lida com o tráfego HTTPS (Porta 443)
|
||||||
|
|
@ -56,6 +53,51 @@ server {
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Content-Type-Options "nosniff" always;
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header Referrer-Policy "no-referrer" always;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
|
brotli on;
|
||||||
|
brotli_comp_level 6;
|
||||||
|
brotli_types application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/xml;
|
||||||
|
brotli_min_length 1024; # Compressão a partir de 1024 bytes
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any; # Compacta respostas de proxy
|
||||||
|
gzip_comp_level 6;
|
||||||
|
gzip_buffers 16 8k;
|
||||||
|
gzip_http_version 1.1;
|
||||||
|
gzip_min_length 1024; # Compressão a partir de 1024 bytes
|
||||||
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||||
|
|
||||||
|
|
||||||
|
# --- Cache de Proxy para Ativos Estáticos ---
|
||||||
|
# Cacheia arquivos estáticos comuns servidos pelo backend
|
||||||
|
location ~* \.(css|js|jpg|jpeg|gif|png|svg|ico|woff|woff2|ttf|eot)$ {
|
||||||
|
# --- Configurações do Proxy (Idênticas ao /) ---
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_connect_timeout 600;
|
||||||
|
proxy_send_timeout 600;
|
||||||
|
proxy_read_timeout 600;
|
||||||
|
proxy_buffers 32 4k;
|
||||||
|
#proxy_ssl_trusted_certificate /etc/nginx/ssl/vcenter_backend.pem;
|
||||||
|
#proxy_ssl_verify on;
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
proxy_ssl_name vcenter.itguys.com.br;
|
||||||
|
proxy_pass https://vcenter_backend;
|
||||||
|
|
||||||
|
# --- Diretivas de Cache ---
|
||||||
|
proxy_cache vcenter_cache;
|
||||||
|
proxy_cache_valid 200 302 60m;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_cache_key "$scheme$request_method$host$request_uri";
|
||||||
|
proxy_cache_min_uses 1;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
|
||||||
|
# Adiciona um header para debug (verificar se o cache está HIT/MISS/BYPASS)
|
||||||
|
add_header X-Proxy-Cache $upstream_cache_status;
|
||||||
|
}
|
||||||
|
|
||||||
# --- Configurações do Proxy Reverso ---
|
# --- Configurações do Proxy Reverso ---
|
||||||
location / {
|
location / {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue