Multiple Django Project + Nginx on subpath

后端 未结 2 409
心在旅途
心在旅途 2021-01-22 11:25

I am trying to run multiple dashboards written in Django to run on my server, but am not getting it up and running. Followed this digital ocean tutorial and modified it accordin

相关标签:
2条回答
  • 2021-01-22 12:18

    So the good news is that your gunicorn and nginx configs as posted look correct.

    (1) Problem #1 default web page shows:

    This is almost always caused by the default nginx config file default.conf. Just remove that file and you should see your site popping up instead. The only other thing to check for is to test and reload nginx to make sure your configuration is valid and loaded:

    sudo nginx -t
    sudo systemctl reload nginx
    

    (2) Problem #2 curl to the unix socket doesn't return what you'd expect. The curl command looks slightly off: try something like:

    curl -v --no-buffer --unix-socket /run/gunicorn_fdab.sock http://localhost/route/available/in/django
    

    You can pair that curl while tailing the gunicorn logs with journalctl --since today -u gunicorn -f

    0 讨论(0)
  • 2021-01-22 12:19

    I suggest you try not doing any URL rewrites in the nginx config. Do the proxy_pass to the sockets as required, and then adapt your Django URL configs to match the URLs you want to use in the different apps.

    0 讨论(0)
提交回复
热议问题