django、gunicorn和Nginx的502错误

django、gunicorn和Nginx的502错误,django,nginx,gunicorn,Django,Nginx,Gunicorn,几天来,我一直在尝试将django设置为与nginx和gunicorn合作,遵循设置指南,尝试在此论坛中找到的许多解决方案,但没有一个对我有效 这是我的第一篇stackoverflow文章,如果它的格式错误或者写得不好,根据你喜欢的阅读方式,我希望听到它,以便我可以改进 从文件夹中启动gunicorn /home/django/virtualenv/sio/SiO 运行命令 gunicorn --bind 0.0.0.0:8000 SiO.wsgi:application 工作很好,我试着将

几天来,我一直在尝试将django设置为与nginx和gunicorn合作,遵循设置指南,尝试在此论坛中找到的许多解决方案,但没有一个对我有效

这是我的第一篇stackoverflow文章,如果它的格式错误或者写得不好,根据你喜欢的阅读方式,我希望听到它,以便我可以改进

从文件夹中启动gunicorn

/home/django/virtualenv/sio/SiO
运行命令

gunicorn --bind 0.0.0.0:8000 SiO.wsgi:application
工作很好,我试着将它设置为sock文件夹。但我最近尝试的是wsgi.py文件所在的/home/django/virtualenv/sio/sio/sio

当查看nginx错误日志时,我发现

2017/05/03 13:56:34 [emerg] 29248#29248: invalid number of arguments in "proxy_pass" directive in /etc/nginx/sites-enabled/sio:12
2017/05/03 13:58:54 [crit] 29275#29275: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:03:53 [crit] 29275#29275: *4 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:06:02 [crit] 29422#29422: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:11:51 [crit] 29422#29422: *5 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:13:10 [crit] 29422#29422: *9 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:25:34 [crit] 29422#29422: *11 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 14:51:30 [crit] 712#712: *1 connect() to unix:/home/django/virtualenv/sio/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO.sock:/", host: "67.207.75.163"
2017/05/03 15:00:41 [crit] 954#954: *1 connect() to unix:/home/django/virtualenv/sio/SiO/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO/SiO.sock:/", host: "67.207.75.163"
2017/05/03 15:02:00 [crit] 1069#1069: *1 connect() to unix:/home/django/virtualenv/sio/SiO/SiO.sock failed (2: No such file or directory) while connecting to upstream, client: 158.39.197.123, server: 67.207.75.163, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/virtualenv/sio/SiO/SiO.sock:/", host: "67.207.75.163"
我的项目中没有.sock文件。我试着修理

项目结构的树状图:

|-- SiO
|   |-- calapp
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   |-- css
|   |   |   |   |-- calendar.css
|   |   |   |   |-- responsive.css
|   |   |   |   `-- sidebar.css
|   |   |   `-- js
|   |   |       |-- calendar.js
|   |   |       `-- jquery-1.12.4.min.js
|   |   |-- templates
|   |   |   `-- calapp
|   |   |       |-- calendar (copy).html
|   |   |       `-- calendar.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- forms.py
|   |   |-- __init__.py
|   |   |-- models.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- chart
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   |-- css
|   |   |   |   `-- chart.css
|   |   |   `-- js
|   |   |       `-- chart.js
|   |   |-- templates
|   |   |   `-- chart
|   |   |       `-- ChartView.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- __init__.py
|   |   |-- models.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- CoAdmin
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   |-- 0001_initial.cpython-35.pyc
|   |   |   |   |-- 0002_auto_20170413_0316.cpython-35.pyc
|   |   |   |   |-- 0003_auto_20170413_1514.cpython-35.pyc
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   |-- 0001_initial.py
|   |   |   |-- 0002_auto_20170413_0316.py
|   |   |   |-- 0003_auto_20170413_1514.py
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- forms.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- serializers.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   `-- css
|   |   |       `-- signup.css
|   |   |-- templates
|   |   |   `-- CoAdmin
|   |   |       |-- admin_delete.html
|   |   |       |-- admin_edit.html
|   |   |       |-- admin_overview.html
|   |   |       |-- InnsideSignup.html
|   |   |       |-- password.html
|   |   |       `-- signup.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- forms.py
|   |   |-- __init__.py
|   |   |-- models.py
|   |   |-- serializers.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- core
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- forms.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   |-- css
|   |   |   |   |-- animate.css
|   |   |   |   |-- cover.css
|   |   |   |   |-- dashboard.css
|   |   |   |   |-- network.css
|   |   |   |   `-- profile.css
|   |   |   |-- img
|   |   |   |   |-- logo.svg
|   |   |   |   `-- SiOLogo.png
|   |   |   `-- js
|   |   |       `-- picture.js
|   |   |-- templates
|   |   |   `-- core
|   |   |       |-- cover.html
|   |   |       |-- dashboard.html
|   |   |       |-- partial_settings_menu.html
|   |   |       |-- password.html
|   |   |       |-- profile.html
|   |   |       `-- settings.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- forms.py
|   |   |-- __init__.py
|   |   |-- models.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- member
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   |-- 0001_initial.cpython-35.pyc
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   |-- 0001_initial.py
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- forms.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- serializers.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   `-- css
|   |   |       |-- member_overview.css
|   |   |       `-- member_signup.css
|   |   |-- templates
|   |   |   `-- member
|   |   |       |-- asoc_signup.html
|   |   |       |-- member_confirm_delete.html
|   |   |       |-- member_delete.html
|   |   |       |-- member_edit.html
|   |   |       |-- member_overview.html
|   |   |       `-- member_signup.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- forms.py
|   |   |-- __init__.py
|   |   |-- models.py
|   |   |-- serializers.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- post
|   |   |-- migrations
|   |   |   |-- __pycache__
|   |   |   |   |-- 0001_initial.cpython-35.pyc
|   |   |   |   |-- 0002_auto_20170413_1514.cpython-35.pyc
|   |   |   |   |-- 0003_remove_email_sendstatus.cpython-35.pyc
|   |   |   |   `-- __init__.cpython-35.pyc
|   |   |   |-- 0001_initial.py
|   |   |   |-- 0002_auto_20170413_1514.py
|   |   |   |-- 0003_remove_email_sendstatus.py
|   |   |   `-- __init__.py
|   |   |-- __pycache__
|   |   |   |-- admin.cpython-35.pyc
|   |   |   |-- __init__.cpython-35.pyc
|   |   |   |-- mail.cpython-35.pyc
|   |   |   |-- models.cpython-35.pyc
|   |   |   |-- urls.cpython-35.pyc
|   |   |   `-- views.cpython-35.pyc
|   |   |-- static
|   |   |   |-- css
|   |   |   |   `-- post.css
|   |   |   `-- javascript
|   |   |       `-- post.js
|   |   |-- templates
|   |   |   `-- post
|   |   |       `-- post.html
|   |   |-- admin.py
|   |   |-- apps.py
|   |   |-- __init__.py
|   |   |-- mail.py
|   |   |-- models.py
|   |   |-- tests.py
|   |   |-- urls.py
|   |   `-- views.py
|   |-- __pycache__
|   |   |-- __init__.cpython-35.pyc
|   |   |-- settings.cpython-35.pyc
|   |   |-- urls.cpython-35.pyc
|   |   `-- wsgi.cpython-35.pyc
|   |-- static
|   |   |-- css
|   |   |   |-- jquery.Jcrop.min.css
|   |   |   `-- SiO.css
|   |   |-- img
|   |   |   |-- sio-logo.jpg
|   |   |   `-- user.png
|   |   `-- js
|   |       |-- date.js
|   |       |-- ga.js
|   |       |-- jquery.bullseye-1.0-min.js
|   |       |-- jquery.Jcrop.min.js
|   |       |-- jquery.selection.js
|   |       |-- jquery.typeahead.bundle.js
|   |       |-- SiO.js
|   |       `-- SiO.markdown.js
|   |-- templates
|   |   |-- admin
|   |   |   `-- chart_association.html
|   |   |-- 403.html
|   |   |-- 404.html
|   |   |-- 500.html
|   |   `-- base.html
|   |-- __init__.py
|   |-- settings.py
|   |-- urls.py
|   `-- wsgi.py
|-- staticfiles
|   |-- admin
|   |   |-- css
|   |   |   |-- base.css
|   |   |   |-- changelists.css
|   |   |   |-- dashboard.css
|   |   |   |-- fonts.css
|   |   |   |-- forms.css
|   |   |   |-- login.css
|   |   |   |-- rtl.css
|   |   |   `-- widgets.css
|   |   |-- fonts
|   |   |   |-- LICENSE.txt
|   |   |   |-- README.txt
|   |   |   |-- Roboto-Bold-webfont.woff
|   |   |   |-- Roboto-Light-webfont.woff
|   |   |   `-- Roboto-Regular-webfont.woff
|   |   |-- img
|   |   |   |-- gis
|   |   |   |   |-- move_vertex_off.svg
|   |   |   |   `-- move_vertex_on.svg
|   |   |   |-- calendar-icons.svg
|   |   |   |-- icon-addlink.svg
|   |   |   |-- icon-alert.svg
|   |   |   |-- icon-calendar.svg
|   |   |   |-- icon-changelink.svg
|   |   |   |-- icon-clock.svg
|   |   |   |-- icon-deletelink.svg
|   |   |   |-- icon-no.svg
|   |   |   |-- icon-unknown-alt.svg
|   |   |   |-- icon-unknown.svg
|   |   |   |-- icon-yes.svg
|   |   |   |-- inline-delete.svg
|   |   |   |-- LICENSE
|   |   |   |-- README.txt
|   |   |   |-- search.svg
|   |   |   |-- selector-icons.svg
|   |   |   |-- sorting-icons.svg
|   |   |   |-- tooltag-add.svg
|   |   |   `-- tooltag-arrowright.svg
|   |   `-- js
|   |       |-- admin
|   |       |   |-- DateTimeShortcuts.js
|   |       |   `-- RelatedObjectLookups.js
|   |       |-- vendor
|   |       |   |-- jquery
|   |       |   |   |-- jquery.js
|   |       |   |   |-- jquery.min.js
|   |       |   |   `-- LICENSE-JQUERY.txt
|   |       |   `-- xregexp
|   |       |       |-- LICENSE-XREGEXP.txt
|   |       |       |-- xregexp.js
|   |       |       `-- xregexp.min.js
|   |       |-- actions.js
|   |       |-- actions.min.js
|   |       |-- calendar.js
|   |       |-- cancel.js
|   |       |-- change_form.js
|   |       |-- collapse.js
|   |       |-- collapse.min.js
|   |       |-- core.js
|   |       |-- inlines.js
|   |       |-- inlines.min.js
|   |       |-- jquery.init.js
|   |       |-- popup_response.js
|   |       |-- prepopulate_init.js
|   |       |-- prepopulate.js
|   |       |-- prepopulate.min.js
|   |       |-- SelectBox.js
|   |       |-- SelectFilter2.js
|   |       |-- timeparse.js
|   |       `-- urlify.js
|   |-- css
|   |   |-- animate.css
|   |   |-- bootstrap-datetimepicker.css
|   |   |-- bootstrap.min.css
|   |   |-- calendar.css
|   |   |-- chart.css
|   |   |-- cover.css
|   |   |-- dashboard.css
|   |   |-- datetimepicker.css
|   |   |-- jquery.Jcrop.min.css
|   |   |-- member_overview.css
|   |   |-- member_signup.css
|   |   |-- network.css
|   |   |-- post.css
|   |   |-- profile.css
|   |   |-- responsive.css
|   |   |-- sidebar.css
|   |   |-- signup.css
|   |   `-- SiO.css
|   |-- fonts
|   |   |-- glyphicons-halflings-regular.eot
|   |   |-- glyphicons-halflings-regular.svg
|   |   |-- glyphicons-halflings-regular.ttf
|   |   |-- glyphicons-halflings-regular.woff
|   |   `-- glyphicons-halflings-regular.woff2
|   |-- img
|   |   |-- logo.svg
|   |   |-- sio-logo.jpg
|   |   |-- SiOLogo.png
|   |   `-- user.png
|   |-- javascript
|   |   `-- post.js
|   |-- js
|   |   |-- locales
|   |   |   |-- bootstrap-datetimepicker.ar.js
|   |   |   |-- bootstrap-datetimepicker.bg.js
|   |   |   |-- bootstrap-datetimepicker.ca.js
|   |   |   |-- bootstrap-datetimepicker.cs.js
|   |   |   |-- bootstrap-datetimepicker.da.js
|   |   |   |-- bootstrap-datetimepicker.de.js
|   |   |   |-- bootstrap-datetimepicker.ee.js
|   |   |   |-- bootstrap-datetimepicker.el.js
|   |   |   |-- bootstrap-datetimepicker.es.js
|   |   |   |-- bootstrap-datetimepicker.fi.js
|   |   |   |-- bootstrap-datetimepicker.fr.js
|   |   |   |-- bootstrap-datetimepicker.he.js
|   |   |   |-- bootstrap-datetimepicker.hr.js
|   |   |   |-- bootstrap-datetimepicker.hu.js
|   |   |   |-- bootstrap-datetimepicker.id.js
|   |   |   |-- bootstrap-datetimepicker.is.js
|   |   |   |-- bootstrap-datetimepicker.it.js
|   |   |   |-- bootstrap-datetimepicker.ja.js
|   |   |   |-- bootstrap-datetimepicker.ko.js
|   |   |   |-- bootstrap-datetimepicker.kr.js
|   |   |   |-- bootstrap-datetimepicker.lt.js
|   |   |   |-- bootstrap-datetimepicker.lv.js
|   |   |   |-- bootstrap-datetimepicker.ms.js
|   |   |   |-- bootstrap-datetimepicker.nb.js
|   |   |   |-- bootstrap-datetimepicker.nl.js
|   |   |   |-- bootstrap-datetimepicker.no.js
|   |   |   |-- bootstrap-datetimepicker.pl.js
|   |   |   |-- bootstrap-datetimepicker.pt-BR.js
|   |   |   |-- bootstrap-datetimepicker.pt.js
|   |   |   |-- bootstrap-datetimepicker.ro.js
|   |   |   |-- bootstrap-datetimepicker.rs.js
|   |   |   |-- bootstrap-datetimepicker.rs-latin.js
|   |   |   |-- bootstrap-datetimepicker.ru.js
|   |   |   |-- bootstrap-datetimepicker.sk.js
|   |   |   |-- bootstrap-datetimepicker.sl.js
|   |   |   |-- bootstrap-datetimepicker.sv.js
|   |   |   |-- bootstrap-datetimepicker.sw.js
|   |   |   |-- bootstrap-datetimepicker.th.js
|   |   |   |-- bootstrap-datetimepicker.tr.js
|   |   |   |-- bootstrap-datetimepicker.ua.js
|   |   |   |-- bootstrap-datetimepicker.uk.js
|   |   |   |-- bootstrap-datetimepicker.zh-CN.js
|   |   |   `-- bootstrap-datetimepicker.zh-TW.js
|   |   |-- bootstrap-datetimepicker.js
|   |   |-- calendar.js
|   |   |-- chart.js
|   |   |-- date.js
|   |   |-- ga.js
|   |   |-- jquery-1.12.4.min.js
|   |   |-- jquery.bullseye-1.0-min.js
|   |   |-- jquery.Jcrop.min.js
|   |   |-- jquery.selection.js
|   |   |-- jquery.typeahead.bundle.js
|   |   |-- picture.js
|   |   |-- SiO.js
|   |   `-- SiO.markdown.js
|   `-- rest_framework
|       |-- css
|       |   |-- bootstrap.min.css
|       |   |-- bootstrap-tweaks.css
|       |   |-- default.css
|       |   `-- prettify.css
|       |-- docs
|       |   |-- css
|       |   |   |-- base.css
|       |   |   |-- bootstrap.min.css
|       |   |   |-- bootstrap-theme.min.css
|       |   |   |-- font-awesome-4.0.3.css
|       |   |   |-- highlight.css
|       |   |   `-- jquery.json-view.min.css
|       |   |-- fonts
|       |   |   |-- fontawesome-webfont.eot
|       |   |   |-- fontawesome-webfont.svg
|       |   |   |-- fontawesome-webfont.ttf
|       |   |   |-- fontawesome-webfont.woff
|       |   |   |-- glyphicons-halflings-regular.eot
|       |   |   |-- glyphicons-halflings-regular.svg
|       |   |   |-- glyphicons-halflings-regular.ttf
|       |   |   |-- glyphicons-halflings-regular.woff
|       |   |   `-- glyphicons-halflings-regular.woff2
|       |   |-- img
|       |   |   |-- favicon.ico
|       |   |   `-- grid.png
|       |   `-- js
|       |       |-- api.js
|       |       |-- base.js
|       |       |-- bootstrap.min.js
|       |       |-- highlight.pack.js
|       |       |-- jquery-1.10.2.min.js
|       |       `-- jquery.json-view.min.js
|       |-- fonts
|       |   |-- glyphicons-halflings-regular.eot
|       |   |-- glyphicons-halflings-regular.svg
|       |   |-- glyphicons-halflings-regular.ttf
|       |   |-- glyphicons-halflings-regular.woff
|       |   `-- glyphicons-halflings-regular.woff2
|       |-- img
|       |   |-- glyphicons-halflings.png
|       |   |-- glyphicons-halflings-white.png
|       |   `-- grid.png
|       `-- js
|           |-- ajax-form.js
|           |-- bootstrap.min.js
|           |-- coreapi-0.1.0.js
|           |-- csrf.js
|           |-- default.js
|           |-- jquery-1.12.4.min.js
|           `-- prettify-min.js
|-- manage.py
`-- requirements.txt
我的gunicorn文件位于

/home/django/virtualenv/sio/bin/gunicorn
/etc/systemd/system/gunicorn.service的内容

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=django
Group=www-data
WorkingDirectory=/home/django/virtualenv/sio/SiO
ExecStart=/home/django/virtualenv/sio/bin/gunicorn --workers 3 --bind unix:/home/django/virtualenv/sio/SiO/SiO SiO.wsgi:application

[Install]
WantedBy=multi-user.target
和my/etc/nginx/sites available/sio文件

server {
    listen 80;
    server_name 67.207.75.163;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/django/virtualenv/sio/SiO;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/django/virtualenv/sio/SiO/SiO.sock;
    }
}
当试图仅使用django构建的inn Web服务器运行时,该站点可以正常工作。当尝试使用gunicorn访问时,我得到一个502错误

这行中缺少“.sock”:

ExecStart=/home/django/virtualenv/sio/bin/gunicorn--workers 3--bind unix:/home/django/virtualenv/sio/sio/sio.wsgi:application

您绑定到的是一个文件夹而不是一个sock文件,但您告诉nginx查找/home/django/virtualenv/sio/sio/sio.sock

因此,不妨尝试一下:

ExecStart=/home/django/virtualenv/sio/bin/gunicorn--workers 3--bind unix:/home/django/virtualenv/sio/sio/sio.sock sio.wsgi:application


编辑:顺便说一句,我是这个设置的忠实粉丝,对它的推荐也不够高-

进行您建议的更改并没有解决问题,尝试您在新VM中发送的指南是否解决了所有问题。非常感谢。这真是太棒了,通常数字海洋指南是我的目标,但你说服了我去其他地方看看:)

nginx和gunicorn作为不同的用户运行。nginx是否可以读取/home/django?如果unix套接字有问题,为什么不使用tcp/ip,直到解决这个问题?