Welcome! Log In Create A New Profile


URL Rewriting + PHP

Posted by iMeee 
URL Rewriting + PHP
December 26, 2009 03:32PM

Here is my problem : I used a French tutorial for setting up PHP with Nginx (http://www.maximegaillard.com/1961-tuto-installation-nginx-php.html). The only problem is that when I use the url rewriting my script is not interpreted and nginx returns the php file itself. How to make nginx passes first php file to process php ?

Excuse my English, it's the Google translator :D. Thank you for your help:)
Re: URL Rewriting + PHP
December 26, 2009 07:53PM

Please post your entire nginx.conf and any fastcgi parameters you are passing.

Are you certain that PHP is running?

Jim Ohlstein
Re: URL Rewriting + PHP
December 27, 2009 03:48AM
My file is on a server accessible but it is the same as the site.

location ~ .php$ {
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

I've never touched the FastCGI configuration file
Re: URL Rewriting + PHP
December 27, 2009 10:51AM
Are you saying this works without the rewrites but fails with the rewrites?

Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready