nginx-apache-Laravel部署504 Gateway Time-out问题

部署策略:

1、nginx提供反向代理

2、wampServer提供php运行环境

问题:偶尔出现504 Gateway Time-out

一、nginx配置优化

server {
        listen       8080;
        server_name  localhost;

        #access_log  logs/host.access.log  main;

        location / {
            root   D:/dist;
            index  index.html index.htm;
		}
		location ~ ^/(api)/  {
			proxy_redirect off;
			proxy_set_header Host $http_host;
			proxy_set_header X-Forwarded-Proto $scheme;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header Upgrade $http_upgrade; 
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_connect_timeout 18000;
			proxy_send_timeout 18000;
			proxy_read_timeout 18000;
			proxy_pass http://127.0.0.1:8081;
		}
    }

 

分享到:更多 ()