今天開發的同事從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