我正在尝试托管一个由 django 应用程序和由tilestache 提供的地图图块组成的站点。我可以通过使用任何一个来让它们分别运行和提供内容
gunicorn_django -b 0.0.0.0:8000
对于 django 应用程序,或
gunicorn "TileStache:WSGITileServer('tilestache.cfg')"
为tilestache。我已经尝试守护 django 应用程序并在不同端口 ( ) 上使用 tilestache 进程同时运行它们8080
,但 tilestache 不起作用。我认为问题在于我的 nginx conf:
server {
listen 80;
server_name localhost;
access_log /opt/django/logs/nginx/vc_access.log;
error_log /opt/django/logs/nginx/vc_error.log;
# no security problem here, since / is alway passed to upstream
root /opt/django/;
# serve directly - analogous for static/staticfiles
location /media/ {
# if asset versioning is used
if ($query_string) {
expires max;
}
}
location /static/ {
# if asset versioning is used
if ($query_string) {
expires max;
}
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://localhost:8000/;
}
# what to serve if upstream is not available or crashes
error_page 500 502 503 504 /media/50x.html;
}
我可以server
在 conf 中添加另一个块proxy_pass http://localhost:8080/
吗?此外,我对这个堆栈非常陌生(我非常依赖Adrián Deccico的教程来启动和运行 django 部分)所以任何“哇,这是一个明显的错误”或建议将不胜感激。