Created
September 28, 2013 01:52
-
-
Save zivee/6737560 to your computer and use it in GitHub Desktop.
使用nginx作为tornado的反向代理服务器的配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 放置在 http 域下 | |
| upstream tornadobackends { | |
| server 127.0.0.1:8000 max_fails=3 fail_timeout=1s; | |
| server 127.0.0.1:8001 max_fails=3 fail_timeout=1s; | |
| server 127.0.0.1:8002 max_fails=3 fail_timeout=1s; | |
| server 127.0.0.1:8003 max_fails=3 fail_timeout=1s; | |
| } | |
| # 放置在 server 域下 | |
| location /api/ { | |
| proxy_read_timeout 120; | |
| proxy_pass_header Server; | |
| proxy_set_header Host $http_host; | |
| proxy_redirect off; | |
| #proxy_set_header Accept-Encoding 'gzip'; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Scheme $scheme; | |
| proxy_pass http://tornadobackends; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment