On Fri, Oct 3, 2014 at 12:33 AM, Kurogane <nginx-forum@nginx.us> wrote:
> No.
>
There is your problem, the config supposed to looks like this:
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;
}
server {
listen 80;
server_name www.domain.com;
root /home/user/public_html;
# proceed with the rest of the config down here
# ...
}
Also, it's not mandatory, but I think you should set the default_server on
the www.domain.com server block
instead of localhost.
Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,253713,253715#msg-253715
>
> _______________________________________________
> 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