开发者

Proxying with django and gunicorn

开发者 https://www.devze.com 2023-01-22 15:10 出处:网络
I have a django application that i serve using gunicorn. I do that by using the method prescribed on the gunicorn site - embedding gunicorn into my django application.

I have a django application that i serve using gunicorn. I do that by using the method prescribed on the gunicorn site - embedding gunicorn into my django application.

I'm trying to set up a proxy into my application so that when you go to "http://mysite.com/proxy/" it does proxy you to "http://mysite.com:8100".

开发者_开发百科

I know i can do that with apache and other webservers. For some reasons i would prefer to do it directly with gunicorn/django. One of theses reasons is keeping everything in the same place.

My question is, what is the best way to do that ? Also is it a terrible idea altogether ?

Thanks.


You should deploy some proxy application into your gunicorn installation, such as WSGIProxy.


I've written dj-revproxy for easy integration of a proxy in django. Bonus point it's using restkit which use the gunicorn HTTP engine. (I'm one of the gunicorn authors). More info here:

https://github.com/benoitc/dj-revproxy

0

精彩评论

暂无评论...
验证码 换一张
取 消