deploy local nginx server to public ubuntu 16.04 deploy local nginx server to public ubuntu 16.04 nginx nginx

deploy local nginx server to public ubuntu 16.04


Your nginx config looks perfectly fine.

To be able to access your server from outside you need a public static IP from your ISP. Also ISP should not block incoming traffic to ports 80 and 443(in case you decide to go with https).

Then you probably have a LAN like this:

ISP <---> Router <---> Server             ^             |             ----> your other devices

In this case public IP will be assigned to router, all other devices will have local private ips like 192.168.x.x/24/10.x.x.x/8/172.16.0.0/20

You need to configure port forwarding to server's private ip from router. Depending on router's vendor this feature may be called virtual server or so and is usually found somewhere near WAN configuration. Set it up to forward TCP port 80 to server local port 80 and the same for 443.

Also you may need to configure server to static ip so that local ip address will not change


I think you have to put

listen *:80

in your file /etc/nginx/sites-enabled/express

nginx listen doc

I think it's not listening for requests from you ISP public IP as you have it now.