nginx 502 bad gateway tomcat怎么解决

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 502 bad gateway tomcat怎么解决相关的知识,希望对你有一定的参考价值。

参考技术A user nobody;
worker_processes 2;

error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

pid logs/nginx.pid;

events
worker_connections 1024;


include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '

access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

gzip on;

upstream tomcat_server
server 192.168.130.128:8080 weight=5;
server 192.168.130.129:8080 weight=5;
ip_hash;


server
listen 80;
server_name localhost;

charset utf-8;

access_log logs/host.access.log main;

location /

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;


error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html
root html;


本回答被提问者和网友采纳

nginx 502 bad gateway

fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;

 

以上是关于nginx 502 bad gateway tomcat怎么解决的主要内容,如果未能解决你的问题,请参考以下文章

Nginx 显示502 Bad Gateway错误

502 bad gateway nginx怎么解决

nginx 502 Bad Gateway 错误解决办法

调试 502 Bad Gateway 错误 - Ubuntu、Nginx、Unicorn

服务器域返回 502 Bad Gateway - Nginx

nginx 502 bad gateway