# Help : How to configure mongrel\_cluster + PHP with nginx

**URL:** <https://www.ruby-forum.com/t/help-how-to-configure-mongrel-cluster-php-with-nginx/188407>\
**Category:** NGINX\
**Created:** [May 11, 2010, 2:46pm UTC](https://www.ruby-forum.com/t/help-how-to-configure-mongrel-cluster-php-with-nginx/188407 "2010-05-11T14:46:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthi\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a87d85/32.png) [@karthi\_r](https://www.ruby-forum.com/u/karthi_r)\
**Post date:** [May 11, 2010, 2:46pm UTC](https://www.ruby-forum.com/t/help-how-to-configure-mongrel-cluster-php-with-nginx/188407/1 "2010-05-11T14:46:52Z")

</div>

Hi Nginx team,

```
         We are running Ruby on Rails application (Mongrel_cluster) 

```

with  
nginx, we tried to install PHP application in same server but the  
proxy\_pass  
not redirected.

How to configure mongrel\_cluster + PHP with nginx same server and same  
domain

Thanks and Regards,  
R.Karthik

---

<div class="post-metadata">

**Author:** ![karthi\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a87d85/32.png) [@karthi\_r](https://www.ruby-forum.com/u/karthi_r)\
**Post date:** [May 11, 2010, 3:00pm UTC](https://www.ruby-forum.com/t/help-how-to-configure-mongrel-cluster-php-with-nginx/188407/2 "2010-05-11T15:00:56Z")

</div>

On Tue, May 11, 2010 at 06:07:37PM +0530, karthi r wrote:

> Hi Nginx team,
> 
> ```
> We are running Ruby on Rails application (Mongrel_cluster) with
> 
> ```
> 
> nginx, we tried to install PHP application in same server but the proxy\_pass  
> not redirected.
> 
> How to configure mongrel\_cluster + PHP with nginx same server and same  
> domain

How does your current configuration look and what URLs should be passed  
to PHP ?

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![karthi\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a87d85/32.png) [@karthi\_r](https://www.ruby-forum.com/u/karthi_r)\
**Post date:** [May 11, 2010, 3:05pm UTC](https://www.ruby-forum.com/t/help-how-to-configure-mongrel-cluster-php-with-nginx/188407/3 "2010-05-11T15:05:37Z")

</div>

On Tue, May 11, 2010 at 7:37 PM, karthi r [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thanks and Regards,  
> R.Karthik

upstream railsapp1 {  
server 127.0.0.1:9000;  
server 127.0.0.1:9001;  
}  
upstream railsapp2 {  
server 127.0.0.1:9010;  
server 127.0.0.1:9011;  
}  
server {  
listen 80;  
server\_name [lotsofapps.com](http://lotsofapps.com);  
location = / { rewrite ^ /phpapp1/ permanent; }  
location ~ ^/phpapp1/.\*.php$ {  
root /srv/http/php;  
fastcgi\_pass 127.0.0.1:9100;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME $request\_filename;  
include fastcgi\_params;  
}  
location /phpapp1/ {  
root /srv/http/php;  
index index.php;  
try\_files $uri $uri/ /phpapp1/index.php;  
}  
location = /phpapp1 { rewrite ^ /phpapp1/ permanent; }  
location @railsapp1 { proxy\_pass [http://railsapp1](http://railsapp1); }  
location = /railsapp1 { rewrite ^ /railsapp1/ permanent; }  
location /railsapp1/ {  
alias /srv/http/rails/railsapp1/public/;  
try\_files $uri @railsapp1;  
expires max;  
}  
location @railsapp2 { proxy\_pass [http://railsapp2](http://railsapp2); }  
location = /railsapp2 { rewrite ^ /railsapp2/ permanent; }  
location /railsapp2/ {  
alias /srv/http/rails/devel/railsapp2/public/;  
try\_files $uri @railsapp2;  
expires max;  
}  
location /whatever/ {  
root /srv/temp;  
autoindex on;  
}  
location /apacheapp/ { proxy\_pass [http://127.0.0.1:9200](http://127.0.0.1:9200); }  
}

etc.

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)
