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

前端 未结 2 1808
日久生厌
日久生厌 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

提交回复
热议问题