【发布时间】:2011-06-19 14:04:54
【问题描述】:
我对服务器部署的东西有点陌生,所以请多多包涵这个菜鸟问题。当我从 nginx 提供静态文件时,我的 webapp 在 apache 上运行。到目前为止,一切都很好。我希望用户应该能够通过直接访问 apache 来访问一些静态文件(反向代理的情况)。这是我的 apache 站点文件。
ServerName enpass.djangoserver
DocumentRoot /srv/www/enpass
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Directory /srv/www/enpass>
Order allow,deny
Allow from all
</Directory>
ProxyPass /nginx/ http://localhost/media/
ProxyPassReverse /nginx/ http://localhost/media/
我的 webapp 基于 django 框架。每当我尝试访问 http://enpass.djangoserver/nginx/foo 之类的东西时,而不是来自 nginx 的数据,我都会从我的 webapp(django) 收到一条错误消息,即 /nginx 不是定义的 URL。 我的配置文件有什么问题?这可能是 URL 请求优先级的问题,但我不知道如何继续。 免责声明:我不久前也在 serverfault 上发布了这个问题。所以不要拍我。
【问题讨论】:
标签: apache nginx reverse-proxy