# WBB ACP HTTPS Rewrite rule

**URL:** <https://www.ruby-forum.com/t/wbb-acp-https-rewrite-rule/245464>\
**Category:** NGINX\
**Created:** [June 4, 2013, 1:54am UTC](https://www.ruby-forum.com/t/wbb-acp-https-rewrite-rule/245464 "2013-06-04T01:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 4, 2013, 1:54am UTC](https://www.ruby-forum.com/t/wbb-acp-https-rewrite-rule/245464/1 "2013-06-04T01:54:22Z")

</div>

Hello,

I’m trying since about half an hour to get SSL-only on the  
administration  
panel of Woltlab burning board working, but without success. The rule  
will  
just be ignored.

What I currently have:  
location /acp/(._)$ {  
if ($server\_port = 80) {  
rewrite ^/(._)$ [https://forum/acp/$1](https://forum/acp/$1) redirect;  
}  
}

Thanks for any help! 🙂

Kind regards,  
Patrik Kernstock

---

<div class="post-metadata">

**Author:** ![Patrik\_Kernstock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@Patrik\_Kernstock](https://www.ruby-forum.com/u/Patrik_Kernstock)\
**Post date:** [June 4, 2013, 2:02am UTC](https://www.ruby-forum.com/t/wbb-acp-https-rewrite-rule/245464/2 "2013-06-04T02:02:33Z")

</div>

Try:

server {  
server\_name forum;

```
...

 location ^~ /acp/ {
     return 301 https://forum$request_uri;
 }

```

}

server {  
server\_name forum;  
listen 443 ssl;

```
....

location / {
    return 301 http://forum$request_uri;
}

 location ^~ /acp/ {
     ...
 }

```

}

----appa

---

<div class="post-metadata">

**Author:** ![Patrik\_Kernstock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@Patrik\_Kernstock](https://www.ruby-forum.com/u/Patrik_Kernstock)\
**Post date:** [June 4, 2013, 2:38am UTC](https://www.ruby-forum.com/t/wbb-acp-https-rewrite-rule/245464/3 "2013-06-04T02:38:46Z")

</div>

Thanks for your fast reply, Antonio!  
I forgot to say, that I try to only enable SSL on ACP on not for the  
rest of  
the forum 🙂

Von: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] Im Auftrag  
von  
Antnio P. P. Almeida  
Gesendet: Dienstag, 04. Juni 2013 02:02  
An: nginx  
Betreff: Re: WBB ACP HTTPS Rewrite rule

Try:

server {  
server\_name forum;

…

location ^~ /acp/ {  
return 301 https://forum$request\_uri;  
}  
}

server {  
server\_name forum;  
listen 443 ssl;

…

location / {  
return 301 http://forum$request\_uri;  
}

location ^~ /acp/ {  
…  
}  
}
