# How to configure mongrel\_cluster + PHP + SSL with nginx

**URL:** <https://www.ruby-forum.com/t/how-to-configure-mongrel-cluster-php-ssl-with-nginx/188463>\
**Category:** NGINX\
**Created:** [May 12, 2010, 11:40am UTC](https://www.ruby-forum.com/t/how-to-configure-mongrel-cluster-php-ssl-with-nginx/188463 "2010-05-12T11:40:06Z")\
**Posts on this page:** 2\
**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 12, 2010, 11:40am UTC](https://www.ruby-forum.com/t/how-to-configure-mongrel-cluster-php-ssl-with-nginx/188463/1 "2010-05-12T11:40:06Z")

</div>

[http://nginx.org/en/docs/http/configuring\_https\_servers.html](http://nginx.org/en/docs/http/configuring_https_servers.html)

I tried following steps below link, after i access PHP application ex:  
[https://loclahost/phpapp1/](https://loclahost/phpapp1/) [http://loclahost/php/](http://loclahost/php/) asking save as  
index.php

[http://nginx.org/en/docs/http/configuring\_https\_servers.html](http://nginx.org/en/docs/http/configuring_https_servers.html)

This sample my sample nginx config file  
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 443;  
server\_name [mydomain.com](http://mydomain.com);  
ssl on;  
ssl\_certificate mydomain\_com.crt;  
ssl\_certificate\_key mydomain\_com.key;  
ssl\_protocols SSLv3 TLSv1;  
ssl\_ciphers HIGH:!ADH:!MD5;

}

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

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 12, 2010, 11:48am UTC](https://www.ruby-forum.com/t/how-to-configure-mongrel-cluster-php-ssl-with-nginx/188463/2 "2010-05-12T11:48:53Z")

</div>

On Wed, May 12, 2010 at 03:09:08PM +0530, karthi r wrote:

> This sample my sample nginx config file
> 
> ```
> include fastcgi_params;
> 
> ```
> 
> location  
> expires max;  
> autoindex on;  
> }  
> location /apacheapp/ { proxy\_pass [http://127.0.0.1:9200](http://127.0.0.1:9200); }  
> }

It’s really hard to understand so broken formatted configuration,  
but it’s seems nginx did not accept it (try to run “nginx -t”),  
because of

server {  
listen 443;  
…  
ssl\_ciphers HIGH:!ADH:!MD5;  
}

location …

–  
Igor S.

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