# Re: monit rewrite

**URL:** <https://www.ruby-forum.com/t/re-monit-rewrite/223269>\
**Category:** NGINX\
**Created:** [September 27, 2012, 9:52am UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269 "2012-09-27T09:52:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 27, 2012, 9:52am UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269/1 "2012-09-27T09:52:41Z")

</div>

Yes but the original request AFAIK is for removing monitor from the URI.  
Hence the regex capture.

–appa

Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a écrit :

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [September 27, 2012, 9:56am UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269/2 "2012-09-27T09:56:11Z")

</div>

On Thu, Sep 27, 2012 at 09:53:25AM +0200, Antnio P. P. Almeida wrote:

> Yes but the original request AFAIK is for removing monitor from the URI. Hence  
> the regex capture.

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

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/;
}

```

–  
Igor S.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [September 27, 2012, 12:30pm UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269/3 "2012-09-27T12:30:27Z")

</div>

On Thu, Sep 27, 2012 at 11:17:49AM +0100, Mark A. wrote:

> > ```
> > proxy_pass http://127.0.0.1/remote/;
> > }
> > 
> > ```
> 
> 1. Does what is documented about proxy\_pass:  
> [Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)  
> also applies to fastcgi\_pass ?  
> [Module ngx\_http\_fastcgi\_module](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.

> }  
> Yes.

–  
Igor S.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [September 27, 2012, 1:25pm UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269/4 "2012-09-27T13:25:21Z")

</div>

On Thu, 27 Sep 2012 14:29:48 +0400, Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 1. Does what is documented about proxy\_pass:  
> > also applies to fastcgi\_pass ?  
> > No. The main reason is that there is no URI entity per se in FastCGI.

> > 1. Would the following be ok?  
> > Yes.

Thank you very much Igor.

---

<div class="post-metadata">

**Author:** ![SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@SSAntS\_nio\_PSPSAlm](https://www.ruby-forum.com/u/SSAntS_nio_PSPSAlm)\
**Post date:** [September 27, 2012, 12:18pm UTC](https://www.ruby-forum.com/t/re-monit-rewrite/223269/5 "2012-09-27T12:18:45Z")

</div>

On Thu, 27 Sep 2012 11:55:38 +0400, Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Thu, Sep 27, 2012 at 09:53:25AM +0200, António P. P. Almeida wrote:

> [Module ngx\_http\_proxy\_module](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:  
[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)  
also applies to fastcgi\_pass ?  
[Module ngx\_http\_fastcgi\_module](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_pass)

2. And is it also valid if using an unix socket instead of  
[http://127.0.0.1/](http://127.0.0.1/)?  
Would the following be ok?  
location ^~ /owncloud4/ {  
location ~ ^(?.+.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;  
}  
}

Thank you,  
Mark
