rewrite URL from http to https
February 04, 2012 09:51AM
Hi,

I am new to nginx, I have setup http and https for the same domain.

I wanted to redirect only 1 location from http to https and not the entire domain.


Like, http://test.com/irfan to https://test.com/irfan

I have tried following but I gets error while reloading nginx


location /irfan {
root /var/www/nginx-default;
# rewrite ^ https://test.com/irfan permanent;

index index.html index.htm;
expires 1m;
}


Thanks in advance
Re: rewrite URL from http to https
February 07, 2012 11:23AM
Can someone support?

Thanks in advance
Re: rewrite URL from http to https
February 11, 2012 10:38AM
rewrite ^(.*) https://domain.org$1 permanent;

Put it OUTSITE the location {

}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 322
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready