Welcome! Log In Create A New Profile

Advanced

Re: Confusion about rewritten uri passed to a fastcgi program

Maxim Dounin
January 10, 2019 08:20AM
Hello!

On Wed, Jan 09, 2019 at 03:05:22PM -0800, Mark Sellers wrote:

>
> My module (ngx_http_fastimg_module) rewrites the uri of an image request. If the image is not yet in the filesystem, then it (using try_files) calls a fastcgi (fastimg_fcgi) that creates the image, serves it, and saves it in the file system.
>
> I have noticed something that I don’t understand. When the fastcgi program is executed, it receives the original uri in the REQUEST_URI fastcgi param, and not the rewritten uri.
>
> I also notice that the rewritten uri is available in the DOCUMENT_URI fastcgi param.
>
> Is this what you would expect?

What is sent in FastCGI parameters is determined by the
fastcgi_param directives used in your configuration, see
http://nginx.org/r/fastcgi_param. The example/default
fastcgi_params file as shipped with nginx contains

fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;

so the REQUEST_URI param will get the original URI as sent by the
client, and the rewritten URI will be available in DOCUMENT_URI,
exactly as your observe.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Confusion about rewritten uri passed to a fastcgi program

Mark Sellers 115 January 09, 2019 06:06PM

Re: Confusion about rewritten uri passed to a fastcgi program

Maxim Dounin 50 January 10, 2019 08:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 75
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