# Please help me

**URL:** <https://www.ruby-forum.com/t/please-help-me/211601>\
**Category:** NGINX\
**Created:** [September 8, 2011, 4:21pm UTC](https://www.ruby-forum.com/t/please-help-me/211601 "2011-09-08T16:21:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 8, 2011, 4:21pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/1 "2011-09-08T16:21:23Z")

</div>

Hi guys,

I’m new to nginx. Just knew how to use it few months ago.

I got a QuickSSL SSL, but I would like to install it only on mybb admin  
folder only ([http://myforum.com/admin](http://myforum.com/admin) will rewrite to  
[https://myforum.com/admin](https://myforum.com/admin)) and keep the rest of the site uses http.

Only [http://myforum.com/admin](http://myforum.com/admin) will redirect to  
[https://myforum.com/admin](https://myforum.com/admin). It didn’t work with any existing file inside  
admin (for example: admin/index.php).

Here is my current nginx config:

server {  
listen 80;  
server\_name [domain.com](http://domain.com) [www.domain.com](http://www.domain.com);  
root /var/www/domain.com;  
include /etc/nginx/fastcgi\_php;  
index index.php index.html;  
location / {

```
    }
}
location /admin {
    rewrite ^/ https://$http_host$request_uri permanent;
}

```

}

server {  
listen 443 ssl;  
ssl\_certificate /etc/nginx/ssl/csr.csr;  
ssl\_certificate\_key /etc/nginx/ssl/csr.key;  
keepalive\_timeout 60;  
ssl\_protocols SSLv2 SSLv3 TLSv1;  
ssl\_ciphers  
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;  
ssl\_prefer\_server\_ciphers on;

```
server_name domain.com www.domain.com;
root /var/www/domain.com;
include /etc/nginx/fastcgi_php;
index index.php index.html;
location / {
    rewrite ^ http://$http_host$request_uri permanent;
}
location /admin {
}

```

}

I don’t know how to fix it, please help.

Thank in advanced,  
Giang

Posted at Nginx Forum:

> **[Please help me](https://forum.nginx.org/read.php?2,214981,214981#msg-214981)**
>
> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site...

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [September 8, 2011, 7:36pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/2 "2011-09-08T19:36:30Z")

</div>

server {  
listen 80;  
server\_name [domain.com](http://domain.com) [www.domain.com](http://www.domain.com);  
root /var/www/domain.com;  
include /etc/nginx/fastcgi\_php;  
index index.php index.html;  
rewrite ^/admin https://$http\_host$request\_uri permanent;  
}

server {  
listen 443 ssl;  
ssl\_certificate /etc/nginx/ssl/csr.csr;  
ssl\_certificate\_key /etc/nginx/ssl/csr.key;  
keepalive\_timeout 60;  
ssl\_protocols SSLv2 SSLv3 TLSv1;  
ssl\_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;  
ssl\_prefer\_server\_ciphers on;

server\_name [domain.com](http://domain.com) [www.domain.com](http://www.domain.com);  
root /var/www/domain.com;  
include /etc/nginx/fastcgi\_php;  
index index.php index.html;  
location / {  
rewrite ^/ http://$http\_host$request\_uri permanent;  
}  
location ~ ^/admin {  
break;  
}  
}

MagicBear

Posted at Nginx Forum:

> **[Re: Please help me](https://forum.nginx.org/read.php?2,214981,214985#msg-214985)**
>
> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site...

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 5, 2011, 2:52pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/3 "2011-10-05T14:52:52Z")

</div>

Thank you for your help. But there is some issues. The Browsers didn’t  
recognize my SSL ☹

Posted at Nginx Forum:

> **[Re: Please help me](https://forum.nginx.org/read.php?2,214981,216272#msg-216272)**
>
> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site...

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 5, 2011, 3:38pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/4 "2011-10-05T15:38:00Z")

</div>

On Thu, Sep 08, 2011 at 01:36:09PM -0400, magicbear wrote:

> server {  
> listen 80;  
> server\_name [domain.com](http://domain.com) [www.domain.com](http://www.domain.com);  
> root /var/www/domain.com;  
> include /etc/nginx/fastcgi\_php;  
> index index.php index.html;  
> rewrite ^/admin https://$http\_host$request\_uri permanent;  
> }

It’s better to move /admin rewrite inside “location ^~ /admin”.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 5, 2011, 3:37pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/5 "2011-10-05T15:37:23Z")

</div>

On Thu, Sep 08, 2011 at 10:20:44AM -0400, Giang wrote:

> admin (for example: admin/index.php).
> 
> ```
> }
> }
> location /admin {
> 
> ```

- 

```
location /admin {

```

- 

```
location ^~ /admin {

```

> ```
> rewrite ^/ https://$http_host$request_uri permanent;
> }
> 
> ```
> 
> }

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 5, 2011, 3:41pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/6 "2011-10-05T15:41:43Z")

</div>

And I have no idea why would you enable sslv2 and even sslv3.

Posted at Nginx Forum:

> **[Re: Please help me](https://forum.nginx.org/read.php?2,214981,216277#msg-216277)**
>
> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site...

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 5, 2011, 3:38pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/7 "2011-10-05T15:38:38Z")

</div>

On Wed, Oct 05, 2011 at 08:52:10AM -0400, Giang wrote:

> Thank you for your help. But there is some issues. The Browsers didn’t  
> recognize my SSL ☹

> **[Configuring HTTPS servers](http://nginx.org/en/docs/http/configuring_https_servers.html#chains)**
>
> To configure an HTTPS server, the ssl parameter must be enabled on listening sockets in the server block, and the locations of the server certificate and private key files should be specified:

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Giang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/d2c977/32.png) [@Giang](https://www.ruby-forum.com/u/Giang)\
**Post date:** [October 11, 2011, 2:21pm UTC](https://www.ruby-forum.com/t/please-help-me/211601/8 "2011-10-11T14:21:12Z")

</div>

Thank you all for helping me. I didn’t clearly about why browsers didn’t  
recognize my SSL.

If I remove:  
location / {  
rewrite ^/ http://$http\_host$request\_uri permanent;  
}

The SSL was working fine, I think there were some objects still linking  
using http. Is there any help to solve the problem?

Posted at Nginx Forum:

> **[Re: Please help me](https://forum.nginx.org/read.php?2,214981,216507#msg-216507)**
>
> Hi guys, I'm new to nginx. Just knew how to use it few months ago. I got a QuickSSL SSL, but I would like to install it only on mybb admin folder only (http://myforum.com/admin will rewrite to https://myforum.com/admin) and keep the rest of the site...
