Nginx – 错误的响应头

当安装joomla我面临一个问题与响应头相关。

在安装过程中,ajax post请求发送给服务器,响应状态是303而不是200 ! 所以Ajaxcallback不会触发和安装中断。

我认为这个问题与nginxconfiguration有关,因为我在apache本地服务器上testing它,这里没有问题。

nginx访问日志:

 POST /installation/index.php HTTP/1.1" 303 5 "http://.../installation/index.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" 

apache(本地)访问日志:

 "POST /joomla-test/installation/index.php HTTP/1.1" 200 286 

nginxconfiguration:

 location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass_header Status; <-- tested but not work ! include fastcgi.conf; } 

HTTP 303是redirect。

您提供的configuration片段中没有任何地方可以创build任何redirect。 因此,它来自您提供的块中正在处理的PHP文件,因为我相信:您需要检查PHP应用程序以修复此不希望的redirect。