On Fri, Oct 3, 2014 at 12:39 AM, Adie Nurahmadie <[email protected]>
wrote:

>
> On Fri, Oct 3, 2014 at 12:33 AM, Kurogane <[email protected]> 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
>> [email protected]
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
>
> --
> regards,
> Nurahmadie
> --
>

For reference, http://nginx.org/en/docs/http/converting_rewrite_rules.html

-- 
regards,
Nurahmadie
--
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to