search

Home  >  Q&A  >  body text

python - nginx+uwsgi startup prompt nginx: [emerg] unknown directive "socket"? How to solve it?

Hello everyone, I have been developing a personal website recently and encountered some minor problems during the deployment phase. I would like to ask you for advice. I would be very grateful~Thank you!
During the deployment phase, starting Nginx failed, and the failure message returned was:


Looking at the error message in the second line, it may be that uwsgi.ini is wrong, so I present the configuration information of uwsgi.ini! As follows:


The configuration information is copied directly from the Internet. I have checked it many times and there is no problem. The blog address is http://www.cnblogs.com/jhao/p...
Then it says my nginx .conf is wrong, but in fact I have not touched /etc/nginx/nginx.conf at all. The following is the information of nginx.conf:


But the blog mentioned that the related configuration of /etc/nginx/sites-enabled/default needs to be modified, so my default file is as follows, which was also copied from the blog, but the path name was changed to mine:


If the above can be solved, I would be grateful~Thank you!

世界只因有你世界只因有你2733 days ago1158

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-06-07 09:27:11

    uwsgi.ini file format is wrong!
    There is one missing [uwsgi]!

    [uwsgi]
    socket = 127.0.0.1:3031
    chdir = /home/foobar/myproject/
    wsgi-file = myproject/wsgi.py
    processes = 4
    threads = 2
    stats = 127.0.0.1:9191

    reply
    0
  • Cancelreply