【发布时间】:2015-05-11 15:56:31
【问题描述】:
我想在一台服务器上制作许多 django/gunicorn 应用程序。每个应用程序都侦听一个特定的端口。我的 nginx 配置是这样的:
upstream my_app_2318 {
server unix:/tmp/gunicorn-2318.sock fail_timeout=10s
}
server {
listen *:2318;
server_name example.com;
index index.html index.htm index.php;
access_log /opt/2318/logs/nginx_access.log combined;
error_log /opt/2318/logs/nginx_error.log;
location / {
proxy_pass http://my_app_2318;
proxy_read_timeout 90;
proxy_connect_timeout 90;
proxy_redirect off;
}
}
此配置适用于 GET 请求(当我访问 example.com:2318/my-url 时),但任何 POST 请求(提交表单)将我重定向到 80 端口(@987654323@)。
我的配置有什么问题?
谢谢
【问题讨论】:
-
因为你写了
proxy_redirect off; -
当我输入
proxy_redirect default;时,我遇到了同样的问题 -
检查
Location标头中的确切内容 -
检查您的 html 代码,更具体地说,检查您的
form标记的action属性。 -
@AlexeyTen 我该如何检查?
标签: django nginx port gunicorn