Got 'No such file or directory' error while configuring nginx and uwsgi

前端 未结 2 1806
日久生厌
日久生厌 2021-02-10 13:22

UPDATE: if I don\'t use socket and use 127.0.0.1:3031 instead, everything works fine.

Nginx version is 1.6.3, and uwsgi is 2.0.11.1

相关标签:
2条回答
  • 2021-02-10 14:00

    ngnix runs as a seperate process, so before you start your application you need to stop the ngnix.

    sudo service ngnix stop. Otherwise the socket myapp.socket will not be visible to the ngnix. Even though when you do ls /var/www/myapp/myapp.socket did show up in the terminal results for ls command. Because ngnix was started before you run your app using uwsgi myapp.ini command, ngnix's process doesn't know what that socket myapp.socket is . So the trick to avoid this issue is.

    1. Stop ngnix using sudo service ngnix stop
    2. Start your app uwsgi myapp.ini
    3. Start the ngnix sudo service ngnix start
    0 讨论(0)
  • 2021-02-10 14:06

    Put the daimaduan_preview.ini's socket file into /run instead of /tmp. Like in this answer, your system probably using namespaced temporary directories, which means every service can only see its own files in /tmp.

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