# How to transfer a normal HTTP request to HTTPS?

**URL:** <https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891>\
**Category:** NGINX\
**Created:** [February 22, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891 "2008-02-22T12:51:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@tuta](https://www.ruby-forum.com/u/tuta)\
**Post date:** [February 22, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891/1 "2008-02-22T12:51:15Z")

</div>

Hello all,

I am using nginx/0.5.35 + FastCGI. I need to transfer a normal http  
request to ssl mode. For example;

I own a bittorrent tracker and i need to work with ssl on announces. So  
then if someone trying to send an announce to [http://domain/announce.php](http://domain/announce.php)  
then how can i transfer it to SSL mode? I dont want to change announce  
URL but announce.php must work on SSL mode. Will it transfer this  
request to ssl inside of the box? Or will it works on background?

Simply how to work with ssl on a normal http address?

I’m ready to pay for that or say a thanks 🙂

Thank you for now!

---

<div class="post-metadata">

**Author:** ![tuta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@tuta](https://www.ruby-forum.com/u/tuta)\
**Post date:** [February 22, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891/2 "2008-02-22T13:26:33Z")

</div>

Hello,

First start nginx with ssl support. HINT:  
[http://wiki.codemongers.com/NginxHttpSslModule](http://wiki.codemongers.com/NginxHttpSslModule)  
Second, use rewrite module for redirect. HINT:  
[http://wiki.codemongers.com/NginxHttpRewriteModule](http://wiki.codemongers.com/NginxHttpRewriteModule)

On Fri, Feb 22, 2008 at 1:51 PM, Mustafa T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Simply how to work with ssl on a normal http address?
> 
> I’m ready to pay for that or say a thanks 🙂
> 
> ## Thank you for now!
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
Ð¡ ÑƒÐ²Ð°Ð¶ÐµÐ½Ð¸Ðµ,  
Ð™. Ð“ÐµÐ¾Ñ€Ð³Ð¸ÐµÐ².

WEB: [http://gigavolt-bg.net/](http://gigavolt-bg.net/)  
Blog: [http://live.gigavolt-bg.net/](http://live.gigavolt-bg.net/)

---

<div class="post-metadata">

**Author:** ![tuta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@tuta](https://www.ruby-forum.com/u/tuta)\
**Post date:** [February 22, 2008, 1:56pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891/3 "2008-02-22T13:56:52Z")

</div>

Thank you for your quick reply Mr. Georgiev,

I start my nginx configured with ssl. It is accepting HTTPS requests  
well. Btw i have no idea about rewrite to redirect diffrent requests on  
ports with internal rewrite.

HTTP is accepting port 80 and SSL 443. So then i dont want to get load  
with X2 requests with an external redirect.

So , what is the correct rewrite code for internet transfer? Simply how  
to work announce.php request on SSL without any external rewrite.

Thank you!

Yordan G. wrote:

> Hello,
> 
> First start nginx with ssl support. HINT:  
> [http://wiki.codemongers.com/NginxHttpSslModule](http://wiki.codemongers.com/NginxHttpSslModule)  
> Second, use rewrite module for redirect. HINT:  
> [http://wiki.codemongers.com/NginxHttpRewriteModule](http://wiki.codemongers.com/NginxHttpRewriteModule)
> 
> On Fri, Feb 22, 2008 at 1:51 PM, Mustafa T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Simply how to work with ssl on a normal http address?
> > 
> > I’m ready to pay for that or say a thanks 🙂
> > 
> > ## Thank you for now!
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> –  
> Ð¡ ÑƒÐ²Ð°Ð¶ÐµÐ½Ð¸Ðµ,  
> Ð™. Ð“ÐµÐ¾Ñ€Ð³Ð¸ÐµÐ².
> 
> WEB: [http://gigavolt-bg.net/](http://gigavolt-bg.net/)  
> Blog: [http://live.gigavolt-bg.net/](http://live.gigavolt-bg.net/)

---

<div class="post-metadata">

**Author:** ![tuta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@tuta](https://www.ruby-forum.com/u/tuta)\
**Post date:** [February 22, 2008, 2:26pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891/4 "2008-02-22T14:26:17Z")

</div>

On Fri, Feb 22, 2008 at 01:56:52PM +0100, Mustafa T. wrote:

> to work announce.php request on SSL without any external rewrite.  
> Browser does SSL connection only if it see https:// protocol.  
> If it connect to server using http:// the connection will be plain text.

---

<div class="post-metadata">

**Author:** ![tuta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a5b964/32.png) [@tuta](https://www.ruby-forum.com/u/tuta)\
**Post date:** [February 22, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/how-to-transfer-a-normal-http-request-to-https/129891/5 "2008-02-22T16:00:17Z")

</div>

May be:

location ~ ^/shop {  
rewrite ^/(.\*) [https://mydomain.com/$1](https://mydomain.com/$1) permanent;  
}

On Fri, Feb 22, 2008 at 3:16 PM, Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > Simply how to work with ssl on a normal http address?  
> > > > –  
> > > > –  
> > > > Igor S.  
> > > > [Igor Sysoev](http://sysoev.ru/en/)

–  
Ð¡ ÑƒÐ²Ð°Ð¶ÐµÐ½Ð¸Ðµ,  
Ð™. Ð“ÐµÐ¾Ñ€Ð³Ð¸ÐµÐ².

WEB: [http://gigavolt-bg.net/](http://gigavolt-bg.net/)  
Blog: [http://live.gigavolt-bg.net/](http://live.gigavolt-bg.net/)
