Welcome! Log In Create A New Profile

Advanced

Re: redirection issue

Adie Nurahmadie
October 02, 2014 01:28PM
On Fri, Oct 3, 2014 at 12:22 AM, Kurogane <nginx-forum@nginx.us> wrote:

> Hello All,
>
> I am facing some issue regarding nginx redirection i'm unable to fix it. I
> want to create redirect non www to www but always redirect me to
> default_server how i can fix this issue.
>
> This is what i have
>
> server {
> listen 80 default_server;
> server_name localhost;
> root /home/nginx/default/public;
>
> ....
> }
>
>
> server {
> listen 80;
> server_name domain.com;
> return 301 $scheme://www.domain.com$request_uri;
> root /home/user/public_html;
> ....
> }
>
> When i go to domain.com or www.domain.com i got default document root
>
> If i change server_name domain.com; to server_name domain.com
> www.domain.com; i got redirect loop issue.
>
> Then how i suppose to solve this problem.
>

Do you have another server block with `server_name www.domain.com` which
supposed to handle the actual request?


>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,253713,253713#msg-253713
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--
regards,
Nurahmadie
--
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

redirection issue

Kurogane October 02, 2014 01:22PM

Re: redirection issue

Adie Nurahmadie October 02, 2014 01:28PM

Re: redirection issue

Kurogane October 02, 2014 01:33PM

Re: redirection issue

Adie Nurahmadie October 02, 2014 01:40PM

Re: redirection issue

Adie Nurahmadie October 02, 2014 01:46PM

Re: redirection issue

Kurogane October 02, 2014 01:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready