Subdomain configuration problem

murali kumar stainwash.dev at gmail.com
Mon Jul 20 12:13:42 UTC 2015


Can't believe!! You are right.

Thanks for the suggestion.

On Mon, Jul 20, 2015 at 8:44 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Sun, Jul 19, 2015 at 09:32:14PM +0530, murali kumar wrote:
>
> > Hi,
> >
> > I'm beginner in nginx, and i have searched google and mailing list but no
> > luck.
> >
> > my nginx.conf:
> >
> > http{
> >     server{
> >         listen 80;
> >         server_name example.com www.example.com;
> >         location / {
> >              proxy_pass http://127.0.0.1:aaaa/;
> >         }
> >    }
> >    server{
> >         listen 80;
> >         server_name subdomain.example.com;
> >         location / {
> >              proxy_pass http://127.0.0.1:bbbb/;
> >         }
> >    }
> >    #rest of the default config like acces log, etc
> > }
> >
> >
> >
> > Problem is after adding server block for subdomain, both request (
> > example.com, subdomain.example.com) loading only example.com in browser.
> > If i place subdomain server block listing as first one, both request (
> > example.com, subdomain.example.com) loading subdomain.example.com in
> > browser.
> >
> > Please suggest me what could be the problem.
>
> Likely reason is a typo in the domain name as listen in the
> "server_name" directives.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150720/c86f06cd/attachment.html>


More information about the nginx mailing list