just started playing with nginx for the first time and came up with a subdomain related problem. I have a default nginx server configured (at /etc/nginx/sites-available/default) that looks like this:

server { root /usr/share/nginx/www; index index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { try_files $uri.html $uri $uri/ =404; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } }

Followed by a second server that I wish to be a subdomain:

server { listen 80; server_name subdomain.localhost; root /usr/share/nginx/subdomain; index index.html index.htm; location / { proxy_pass http://127.0.0.1:2368/; proxy_set_header Host $host; proxy_buffering off; } }

Added a new entry to /etc/hosts with 127.0.0.1 subdomain.localhost

I still can ping and curl my subdomain.localhost via ssh but I cannot resolve it via browser (http://subdomain.raspberrypi/ or http://subdomain.192.168.1.184/) and everything is fine when I access my main domain.

Any ideas how to make this work? Thanks.