49 lines
1.5 KiB
Nginx Configuration File
49 lines
1.5 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
|
|
# Compressão Gzip
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 10240;
|
|
gzip_proxied expired no-cache no-store private auth;
|
|
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
# Headers de Segurança
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
add_header X-Content-Type-Options "nosniff";
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
|
|
|
# SPA Routing (Single Page Application)
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Proxy reverso para WPPConnect (Resolve Mixed Content HTTPS -> HTTP)
|
|
location /api-wpp/ {
|
|
proxy_pass http://www.c2wpp.c2sistemas.com.br:22700/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host www.c2wpp.c2sistemas.com.br:22700;
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_read_timeout 90s;
|
|
}
|
|
|
|
# Cache de assets estáticos
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|