V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
AndyCrz
V2EX  ›  Python

tornado 项目的一个问题

  •  
  •   AndyCrz · Mar 26, 2016 · 3457 views
    This topic created in 3684 days ago, the information mentioned may be changed or developed.
    本人写了个基于 tornado 的应用,目前有几个问题
    1.我的 Handler 配置的是 (r'.*'),用 nginx 的时候 location 根本就不跳转过来( nginx 配置也是.*)
    2.有时候会出现 StreamCloseErrror ,请问如何解决?
    lecher
        1
    lecher  
       Mar 26, 2016
    在不启用静态化规则的情况下, nginx 只需要配置域名,把域名所对应的请求全部转发给对应的端口就可以了。
    url 的规则则由 tornado 的 handler 配置进行管理。

    如果路由是 tornado 处理, nginx 只需要配置好 server_name ,把对应域名的请求全部转发给 tornado 的端口就可以了,没必要单独配置 nginx 的 url 规则。
    AndyCrz
        2
    AndyCrz  
    OP
       Mar 26, 2016
    @lecher 路由是 tornado 控制的,能给个具体的方法嘛,目前主要是做代理所以用 server_name 恐怕不行吧
    restran
        3
    restran  
       Mar 27, 2016
    Handler 配置 试试改成 r'/.*', Nginx 改成 location ^~ / { proxy_pass ...}
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 22:19 · PVG 06:19 · LAX 15:19 · JFK 18:19
    ♥ Do have faith in what you're doing.