PostgreSQL 写入数据到Excel时出现 Faithfully yours, nginx 错误处理

今天开发的同事从PostgreSQL中读取数据写到Excel时报错,由于数据较多,而开发的同事写到代码又不够优秀,速度过慢以至于出现问题,找了下资料修改Nginx的配置解决了此问题。详细错误如下:

An error occurred.

Sorry, the page you are looking for is currently unavailable.

Please try again later.
If you are the system administrator of this resource then you should check theerror log for details.
Faithfully yours, nginx.

解决方法:

将Nginx配置文件中的 localhost 改成 ip

或者

修改 hosts 文件 加上 127.0.0.1 localhost

location / {  
    proxy_pass http://localhost:8080  # 修改成127.0.0.1
}  

设置连接时间

proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间(代理连接超时)

proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时)

proxy_read_timeout 600; #连接成功后,后端服务器响应时间(代理接收超时)

修改配置文件后,重新加载配置文件即可:

nginx -s reload