https://stackoverflow.com/questions/7796237/custom-bad-gateway-page-with-nginx
Arquivo da tag: Nginx
Nginx : 2 domínios (dns) no mesmo servidor
How to Set Up Free SSL Certificates from Let’s Encrypt using Docker and Nginx
NGINX 502 Bad Gateway
http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 90;
fastcgi_send_timeout 90;
fastcgi_read_timeout 90;
}
Secure Nginx from Clickjacking with X-FRAME-OPTIONS
5 minute upgrade NGINX 1.12 to 1.17+ on CentOS 7 / RHEL 7
Nginx reverse proxy causing 504 Gateway Timeout
proxy_read_timeout 10000;
Nginx.conf
upstream puma {
server unix:///home/deploy/apps/exemplo/shared/tmp/sockets/exemplo-puma.sock;
}
server {
listen 80 default_server deferred;
server_name exemplo.com www.exemplo.com;
return 301 https://exemplo.com$request_uri;
}
ssl_certificate /etc/letsencrypt/live/exemplo.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/exemplo.com/privkey.pem;
server {
listen 443 ssl;
server_name exemplo.com;
root /home/deploy/apps/exemplo/current/public;
access_log /home/deploy/apps/exemplo/current/log/nginx.access.log;
error_log /home/deploy/apps/exemplo/current/log/nginx.error.log info;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
location /cable {
proxy_pass http://puma;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
}
Nginx: How do I forward a http request to another port?
location /route {
proxy_pass http://127.0.0.1:9000/;
}