简体   繁体   中英

Using uWSGI Emperor Mode to deploy two python applications

Hey I'm having trouble figuring out how to use uWSGI emperor mode with my application. I made two applications but the problem is I have no idea how to use uWSGI in itself or in emperor mode :( Can someone tell me what i need or point me to something useful. Also do I have to use nginx because everytime I google uWSGI it always uses nginx.

Nginx is not the only web server or the official web server to use for your application.

There are some great alternatives to it and you should explore those to understand the pros and cons of it. Some of the alternatives are Apache HTTP Server , lighttpd , etc.

Nginx(a web server) faces the outside world. However, it cannot directly talk to flask application; it needs something that will run the application, feed it requests from web clients(such as the browser) and return responses.

uWSGI is a WSGI( Web Server Gateway Interface ) implementation, which does this job.

I am assuming that you are using UNIX like system. So, we need to create UNIX socket and serve responses to the webserver via WSGI protocol.

The complete stack will look something like this :

the web client <-> the web server <-> the socket <-> the uwsgi <-> flask

This is to give you basic understanding of how this stack works.

You can refer to the detailed configuration to setup this stack on this link .

Once you setup the stack, you can easily configure it run in emperor mode to server multiple python applications using a config file. This blog post will help you in achieving that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM