steve steve at
Tue Sep 20 05:03:59 UTC 2016

Hi folks,

I am running php as fastcgi, replacing a working apache/mod_php setup. 
I'm pretty close, but am not quite there.

The last bit I've got to get working is...

     RewriteRule ^(.*)$ index.php [E=query:$1,L]

Which I understand to mean pass the request in a variable called query.

My (not working ) attempt is:

         location / {
                try_files $uri $uri/ @rewriteapp;

         location @rewriteapp {
                 fastcgi_param query $request_uri;
                 rewrite ^(.*)$ /index.php last;

         # Pass the php scripts to fastcgi server specified in upstream 
         location ~ \.php(/|$) {
             # Unmodified fastcgi_params from nginx distribution.
             include fastcgi_params;
             # Necessary for php.
             fastcgi_split_path_info ^(.+\.php)(/.*)$;
             fastcgi_param PATH_INFO $fastcgi_path_info;
             fastcgi_param SCRIPT_FILENAME 
             fastcgi_param DOCUMENT_ROOT $realpath_root;
             try_files $uri $uri/ /index.php$is_args$args;
             fastcgi_pass backend;

Can anyone point out where I'm going wrong please?



Steve Holdoway BSc(Hons) MIITP
Skype: sholdowa

More information about the nginx mailing list