【问题标题】:nginx as reverse proxy for daphne: 404 not foundnginx 作为 daphne 的反向代理:找不到 404
【发布时间】:2017-07-13 09:10:09
【问题描述】:

这是我的 nginx.conf:

server {
    listen 80;

    location /proxy {
        proxy_pass http://0.0.0.0:8001;     
    }
}

我的服务器是 azure 中的虚拟机。

当我转到 http://13.65.102.226/proxy/ 时,它给出了 404 not found。

这是我的 supervisord.conf:

[program:runworker]
command=python /var/www/app/manage.py runworker
stopsignal=KILL
killasgroup=true

[program:daphne]
command=daphne -b 0.0.0.0 -p 8001 app.asgi:channel_layer -v2

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

有什么建议吗?

【问题讨论】:

  • 您是否尝试过使用debug 进行回溯检查?
  • proxy_pass http://0.0.0.0:8001;更改为proxy_pass http://0.0.0.0:8001/;

标签: azure nginx proxy django-channels daphne


【解决方案1】:

我猜 Nginx 和 Daphne 在同一台服务器上运行。如果是这样,请尝试:

proxy_pass http://127.0.0.1:8001;

【讨论】:

    猜你喜欢
    • 2019-07-31
    • 1970-01-01
    • 1970-01-01
    • 2019-09-23
    • 2015-11-29
    • 1970-01-01
    • 2019-06-06
    • 2021-06-17
    • 1970-01-01
    相关资源
    最近更新 更多