just started playing nginx first time , came subdomain related problem. have default nginx server configured (at /etc/nginx/sites-available/default) looks this:
server { root /usr/share/nginx/www; index index.html index.htm; # make site accessible 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 second server wish 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 new entry /etc/hosts 127.0.0.1 subdomain.localhost
i still can ping , curl subdomain.localhost via ssh cannot resolve via browser (http://subdomain.raspberrypi/ or http://subdomain.192.168.1.184/) , fine when access main domain.
any ideas how make work? thanks.
add hosts on machine using browse 192.168.1.184 subdomain.rpi
Comments
Post a Comment