![](/img/trans.png)
[英]Django, gunicorn, nginx throws 504 Gateway Time-out: AttributeError: module 'static' has no attribute 'Cling'
[英]Django+Nginx+uWSGI = 504 Gateway Time-out
我正在運行 Ubuntu 10.04、Django 1.3、Nginx 0.8.54 和 uWSGI 0.8.7.0。
Nginx 和 uWSGI 都可以正常加載。 但是,當您訪問我的網站時,它會停留很長時間,然后最終加載“504 網關超時”錯誤。
這是我的 Nginx 虛擬主機配置文件:
server {
listen 80;
server_name www.mysite.com mysite.com;
error_log /home/mysite/log/error.log;
access_log /home/mysite/log/access.log;
location / {
auth_basic "Restricted";
auth_basic_user_file /home/mysite/public/passwd;
include uwsgi_params;
uwsgi_pass unix:///home/mysite/public/myapp.sock;
}
location /media {
alias /home/mysite/public/myapp/media;
}
error_page 401 /coming_soon.html;
location /coming_soon.html {
root /home/mysite/public/error_pages/401;
}
location /401/images {
alias /home/mysite/public/error_pages/401/images;
}
location /401/style {
alias /home/mysite/public/error_pages/401/style;
}
}
我的網站日志顯示:
SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request / !!!
我的錯誤日志顯示:
upstream timed out (110: Connection timed out) while reading response header from upstream
我在這台服務器上有兩個其他站點具有相同的配置,它們加載完美。
有沒有其他人遇到過這個問題? 這里有幾個與我的問題相似的線程,我已經嘗試了其中的幾個解決方案,但似乎沒有任何效果。
預先感謝您的幫助!
當請求超過 NGINX uwsgi_read_timeout設置時會產生該錯誤。 在 NGINX 超過此限制后,它會關閉套接字,然后 uWSGI 嘗試寫入關閉的套接字,從而產生您從 uWSIG 看到的錯誤。
確保您的 NGINX 超時至少與 uWSGI 超時 (HARAKIRI_TIMEOUT) 一樣高。
unix:///home/mysite/public/myapp.sock; 語法不正確,像這樣使用:
unix:/home/mysite/public/myapp.sock;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.