简体   繁体   中英

connecting nginx and gunicorn together

i can access to my webserver(nginx) by typing ip address in the web browser and everything works fine! and now i installed Gunicorn and i want to be able to use it with Django projects. i installed it and it works fine. acording to this tutorial: http://gunicorn.org/#quickstart i created a test code and run it. but my problem is that Gunicorn how has connections with nginx? when i enter ip address of my server in the browser i see nginx default page not this python app that i created? how i can see it?

Nignx servers as a reverse proxy server and hands in requests to Gunicorn.
Gunicorn receives requests from Nginx server, handles it, returns results to Nginx and then Nginx responses to the requests.

So firstly, you have to configure Nginx to indicate which server (ip:port) Nignx have to hande in requests to. Configuration is like this . Then you have to configure Gunicorn to listen to some port and how to handle requests. Conifguration is like this .

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