简体   繁体   English

显示默认的 nginx 页面而不是应用程序

[英]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.

相关问题 只有 nginx 默认页面显示在 Docker 容器中 - Only nginx default page showing in Docker container 具有Nginx和Gunicorn的Django应用程序仅显示欢迎页面,其余所有页面均显示404错误 - Django application with nginx and gunicorn only showing welcome page rest all pages showing 404 error 侧边栏默认隐藏而不是显示 - Sidebar hidden by default instead of showing 尝试在守护程序模式下使用mod_wsgi会显示默认的Apache“ It works!”页面,而不是应用程序 - Attempting to use mod_wsgi in daemon mode show default apache “It works!” page instead of application Azure Web 应用程序在成功部署 python 后显示默认页面或应用程序错误 - Azure Web App showing default page or Application Error after successful python deployment nginx配置:显示IP地址而不是域名 - nginx configuration: IP address showing instead of domain name django列出文件而不显示主页 - django listing files instead of showing home page Azure上的Flask网站显示默认登录页面 - Flask Site on Azure showing default landing page Cherrypy应用程序重定向到http而不是nginx后面的https - Cherrypy application redirecting to http instead of https behind nginx Nginx无法正常工作(显示默认页面)(Ubuntu 16.04) - Nginx doesn't work as expected (shows default page)(Ubuntu 16.04)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM