[英]Showing default nginx page instead of application
settings.py
: settings.py
:
ALLOWED_HOSTS = ['64.225.1.249', 'domain.az']
nginx: nginx:
server {
listen 80;
server_name domain.az;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/progbash/ccproject;
}
location / {
proxy_set_header Host $host;
include proxy_params;
proxy_pass http://unix:/home/progbash/ccproject.sock;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
}
}
error:错误:
2019/12/12 02:51:50 [crit] 23765#23765: *1 connect() to unix:/home/progbash/ccproject.sock failed (2: No such file or directory) while connecting to upstream, client: 188.253.227.99, server: domain.az, request: "GET / HTTP/1.1", upstream: "http://unix:/home/progbash/ccproject.sock:/", host: "domain.az"
2019/12/12 03:05:57 [alert] 24056#24056: *12 open socket #3 left in connection 4
2019/12/12 03:05:57 [alert] 24056#24056: *13 open socket #11 left in connection 5
2019/12/12 03:05:57 [alert] 24056#24056: aborting
2019/12/12 03:09:16 [alert] 24143#24143: *11 open socket #11 left in connection 3
2019/12/12 03:09:16 [alert] 24143#24143: *12 open socket #12 left in connection 5
2019/12/12 03:09:16 [alert] 24143#24143: aborting
Although I have project.sock
in the shown location, I've bought domain, connected DigitalOcean's DNS Servers, set up everything as in DigitalOceans's official manual.虽然我在显示的位置有
project.sock
,但我已经购买了域,连接了 DigitalOcean 的 DNS 服务器,按照 DigitalOcean 的官方手册设置了所有内容。 But still seeing this trashy nginx default page instead of application.但仍然看到这个垃圾 nginx 默认页面而不是应用程序。
Change the ownership of the folder where .sock file is located to nginx user and group.将 .sock 文件所在文件夹的所有权更改为 nginx 用户和组。 For your case, try
对于您的情况,请尝试
> sudo chown -R www-data:www-data /home/progbash/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.