NgixProxy_Pathfinder/nginx/conf.d/atendimento.grupopralog.com...

66 lines
2.1 KiB
Plaintext

upstream chatwoot_pralog_backend {
server 172.17.0.3:8082;
}
server {
listen 80;
server_name atendimento.grupopralog.com.br;
include snippets/acme_challenge.conf;
location / {
return 301 https://atendimento.grupopralog.com.br$request_uri;
}
}
server {
listen 443 quic;
listen 443 ssl;
server_name atendimento.grupopralog.com.br;
# Certificados (Ajustar apos geracao via Certbot se necessario)
ssl_certificate /etc/letsencrypt/live/atendimento.grupopralog.com.br/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/atendimento.grupopralog.com.br/privkey.pem;
access_log /var/log/nginx/atendimento.grupopralog.com.br.access.log detailed_proxy;
error_log /var/log/nginx/atendimento.grupopralog.com.br.error.log warn;
include snippets/ssl_params.conf;
include snippets/proxy_params.conf;
include snippets/modsecurity.conf;
include snippets/well_known.conf;
include snippets/security_actions.conf;
proxy_cache dynamic_cache;
set $upstream_proto http;
set $upstream_app chatwoot_pralog_backend;
# Recomendacao Chatwoot/Twilio: Permitir underscores em headers para webhooks
underscores_in_headers on;
location / {
expires 15m;
proxy_cache_valid 200 15m;
proxy_pass http://chatwoot_pralog_backend;
# Force HTTPS for Rails
include snippets/proxy_params.conf;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port 443;
}
# Configuracao obrigatoria para Real-time (WebSockets)
location /cable {
proxy_pass http://chatwoot_pralog_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_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 https;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
access_log off;
}
}