I'm trying to access $_POST
and it's empty.
If I try to access it on the root (ie. localhost
), it WORKS.
If I try to access in a different folder (ie. localhost/foo
), it DOESN'T WORK.
Here is my config file:
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
server_name localhost;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Here is a sample RAW request:
POST /dev/post-test HTTP/1.1
Host: localhost
Cache-Control: no-cache
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="action"
store
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="id"
4315251
----WebKitFormBoundaryE19zNvXGzXaLvS5C
What is the problem?
Thanks.