monit rewrite

Igor Sysoev igor at sysoev.ru
Thu Sep 27 10:29:48 UTC 2012


On Thu, Sep 27, 2012 at 11:17:49AM +0100, Mark Alan wrote:
> On Thu, 27 Sep 2012 11:55:38 +0400, Igor Sysoev <igor at sysoev.ru> wrote:
> > On Thu, Sep 27, 2012 at 09:53:25AM +0200, António P. P. Almeida wrote:
> 
> > http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
> > 
> >   If proxy_pass is specified with URI, when passing a request to the
> >   server, part of a normalized request URI matching the location is
> >   replaced by a URI specified in the directive:
> > 
> >     location /name/ {
> >         proxy_pass http://127.0.0.1/remote/;
> >     }
> 
> 1. Does what is documented about proxy_pass:
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
> also applies to fastcgi_pass ?
> http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_pass

No. The main reason is that there is no URI entity per se in FastCGI.
Instead, there are many ways to say FastCGI servers what it should do.
The common case is a setting script filename in SCRIPT_FILENAME.
But actually FastCGI server can be an application that ignores
SCRIPT_FILENAME and uses, for example, REQUEST_URI instead.

> 2. And is it also valid if using an unix socket instead of http://127.0.0.1/?
> Would the following be ok?
> location ^~ /owncloud4/ {
>   location ~ ^(?<script>.+\.php)(?<path_info>.*)$ {
>     include fastcgi_params;
>     fastcgi_pass unix:/tmp/php-fpm.socket;
>     fastcgi_param SCRIPT_FILENAME $document_root$script;
>     fastcgi_param SCRIPT_NAME $script;
>     fastcgi_param PATH_INFO $path_info;
>   }
> } 

Yes.


-- 
Igor Sysoev
http://nginx.com/support.html



More information about the nginx mailing list