36

I'm running uWSGI behind Nginx and have been using proxy_pass to get Nginx to hit uWSGI. Is there any benefit to switch to uwsgi_pass. If so, what is it?

Eli
  • 36,793
  • 40
  • 144
  • 207
  • Possible duplicate of [Is uwsgi protocol faster than http protocol?](http://stackoverflow.com/questions/11783907/is-uwsgi-protocol-faster-than-http-protocol) – GwynBleidD Jan 02 '16 at 15:29

1 Answers1

51

uwsgi_pass uses an uwsgi protocol. proxy_pass uses normal HTTP to contact with uWSGI server. uWSGI docs claims that this protocol is better, faster and can benefit from all of uWSGI special features.

Are there any real benefits? Yes. You can send to uWSGI information what type of data you are sending and what uWSGI plugin should be invoked to generate response. With http (proxy_pass) you won't get that. More on that you can find in uWSGI docs.

But even if there aren't any documented benefits of using uwsgi protocol instead of http for you, you should use uwsgi protocol if you can, because uwsgi is the main protocol of uWSGI server and it just fits better here.

If you want to use uwsgi protocol you must change http-socket parameter in uWSGI start script to socket.

pts
  • 80,836
  • 20
  • 110
  • 183
GwynBleidD
  • 20,081
  • 5
  • 46
  • 77