› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
matthewgao
V2EX  ›  NGINX

gunicorn 为什么不能直接处理 wsgi?

  •  
  •   matthewgao ·
    matthewgao · Jul 20, 2015 · 4141 views
    This topic created in 4145 days ago, the information mentioned may be changed or developed.

    根据nginx上的配置来看,他是proxy_pass, 而不是uwsgi_pass, 那么不是意味着upstream到gunicorn也是HTTP的咯? 然后gunicorn再转成WSGI去启动Application?

    6 replies  •  2015-07-22 21:48:52 +08:00
    socrates
    socrates
    Jul 20, 2015
    1
    没错,就是你说的这个意思,wsgi只是作为一个标准的python web接口方便大家通信
    zhuangzhuang1988
    zhuangzhuang1988
    Jul 20, 2015
    2
    uwsgi走的是自己的协议!!
    nooper
    nooper
    Jul 20, 2015
    3
    uwsgi 更靠谱些吧。
    matthewgao
    matthewgao
    OP
    Jul 21, 2015 via Android
    4
    @socrates 那么如果我想要传递Nginx中的一些环境变量怎么办? 因为没法用uwsgi_param 放到Http header里?
    socrates
    socrates
    Jul 21, 2015
    5
    @matthewgao 这个可以直接加标准的http header就行,用add_header就行

    btw, uwsgi的协议可以保证一个长连接,会比标准http协议更有效率,另外是uwsgi还可以支持unix sock,如果场景合适的话,效率更快
    julyclyde
    julyclyde
    Jul 22, 2015
    6
    首先,uwsgi和wsgi没啥关系
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4308 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 08:28 · PVG 16:28 · LAX 00:28 · JFK 03:28
    ♥ Do have faith in what you're doing.