Welcome! Log In Create A New Profile


Rewriting kills POST requests parameters

Posted by denn1s 
Rewriting kills POST requests parameters
August 14, 2012 02:14PM
Hello everyone

I'm trying to build Friendly URLs at my Symfony2 website (Nginx + FastCGI PHP) and it looks like POST requests are lost.

Here is my rewriting section:

location / { try_files $uri $uri/ @fallback; }

location @fallback {
fastcgi_pass localhost:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/app.php;

# symfony
location ~ \.php($|/) {
include fastcgi_params;

set $script $uri;
set $path_info "";

if ($uri ~ "^(.+\.php)($|/)") {
set $script $1;

if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass localhost:9000;

fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;

Which is taken from here: https://gist.github.com/879378

Any suggestions why I'm losing all variables in my $_POST variable inside of PHP?
Any good ways to handle POSTs + FriendlyURLs at Nginx?
Re: Rewriting kills POST requests parameters
August 14, 2012 02:15PM
accidently posted. delete this post please

Edited 1 time(s). Last edit at 08/14/2012 02:16PM by denn1s.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready