<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 3, 2014 at 12:39 AM, Adie Nurahmadie <span dir="ltr"><<a href="mailto:nurahmadie@gmail.com" target="_blank">nurahmadie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 3, 2014 at 12:33 AM, Kurogane <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">No.<br></blockquote><div><br></div><div>There is your problem, the config supposed to looks like this:</div><span class=""><div><br></div><span style="font-family:arial,sans-serif;font-size:13px">server {</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">                listen 80 default_server;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">                server_name localhost;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">                root /home/nginx/default/public;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">}</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px"></span><span class=""><span style="font-family:arial,sans-serif;font-size:13px">server {</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        listen 80;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        server_name </span><a href="http://domain.com/" style="font-family:arial,sans-serif;font-size:13px" target="_blank">domain.com</a><span style="font-family:arial,sans-serif;font-size:13px">;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">        return 301 $scheme://</span><a href="http://www.domain.com/" style="font-family:arial,sans-serif;font-size:13px" target="_blank">www.domain.com</a><span style="font-family:arial,sans-serif;font-size:13px">$</span><span style="font-family:arial,sans-serif;font-size:13px">request_uri;</span><br style="font-family:arial,sans-serif;font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px">}</span> <br></div><div><br></div></span><div><span style="font-size:13px;font-family:arial,sans-serif">server {</span><br style="font-size:13px;font-family:arial,sans-serif"><span style="font-size:13px;font-family:arial,sans-serif">        listen 80;</span><br style="font-size:13px;font-family:arial,sans-serif"><span style="font-size:13px;font-family:arial,sans-serif">        server_name www.</span><a href="http://domain.com/" style="font-size:13px;font-family:arial,sans-serif" target="_blank">domain.com</a><span style="font-size:13px;font-family:arial,sans-serif">;</span><br style="font-size:13px;font-family:arial,sans-serif"><span style="font-size:13px;font-family:arial,sans-serif">        root  /home/user/public_html;</span></div><div><br></div><div>        # proceed with the rest of the config down here</div><div>        # ...<br><div><span style="font-family:arial,sans-serif;font-size:13px">}</span> <br></div></div><div><br></div><div>Also, it's not mandatory, but I think you should set the default_server on the <a href="http://www.domain.com" target="_blank">www.domain.com</a> server block</div><div>instead of localhost.</div><div><div class="h5"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,253713,253715#msg-253715" target="_blank">http://forum.nginx.org/read.php?2,253713,253715#msg-253715</a><br>
<div><div><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div></div></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br>regards,<br>Nurahmadie<br>--<br>
</font></span></div></div>
</blockquote></div><br>For reference, <a href="http://nginx.org/en/docs/http/converting_rewrite_rules.html">http://nginx.org/en/docs/http/converting_rewrite_rules.html</a><br clear="all"><div><br></div>-- <br>regards,<br>Nurahmadie<br>--<br>
</div></div>