Flask app on uwsgi/nginx - unix socket file is not created on booting

后端 未结 1 1647
独厮守ぢ
独厮守ぢ 2021-01-13 15:56

I\'m trying to use Flask app on uwsgi/nginx.

Following http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html and http://www.markjberger.com/f

相关标签:
1条回答
  • 2021-01-13 16:28

    The main issue seems to be from the uwsgi service; it just doesn't work.

    I found another way to start uwsgi at startup: upstart and uwsgi --emperor from http://uwsgi-docs.readthedocs.org/en/latest/Upstart.html and http://upstart.ubuntu.com

    The process is just make a flask.conf file in /etc/init directory. uwsgi --emperor controls all the ini files in the uwsgi directory.

    # simple uWSGI script
    # http://uwsgi-docs.readthedocs.org/en/latest/Upstart.html
    
    description "uwsgi tiny instance"
    start on runlevel [2345]
    stop on runlevel [06]
    
    respawn
    
    exec uwsgi --emperor /etc/uwsgi/apps-enabled
    

    I also had to sudo update-rc.d uwsgi disable so that uwsgi service should be disabled.

    I also found this site http://flaviusim.com/blog/Deploying-Flask-with-nginx-uWSGI-and-Supervisor/ for invoking uswgi at startup, but I didn't test it.

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