The two slashes issue - or how to append a constant to a parameter.

Ian Hobson ian at
Fri Feb 6 14:42:13 MSK 2009


I have a situation that I have had to fix using set...

        # handle directory names by adding /index.htm
        location ~ ^(.*)/$ {
                # matches directories
                set $path index.htm;
                fastcgi_param QUERY_STRING f=$request_uri$path;
                fastcgi_param DOCUMENT_ROOT $document_root;
                fastcgi_param SCRIPT_FILENAME /var/www/builder/parser.php;

The issue was that with 

fastcgi_param QUERY_STRING f=$request_uri/index.htm;

I was getting two slashes - one added by nginx and one on the line 
above, even if the entered URI contained none.

Is there a better way of adding a constant after a parameter?




More information about the nginx mailing list