Public server with nginx

by megas   Last Updated September 14, 2018 16:01 PM

I would like to make my development server public.

I have a static ip address from my ISP.

As usually I have a router and server connected to that router. In the router's settings I've set the forwarding port to 3000, so if somebody will try my_public_ip_address:3000, it will be forwarded to my local server.

Nginx config file:

upstream app {
  server points_to_app_on_server;
}

server {
  listen 3000;
  server_name <what is name should be here?>;

  ...
}

Is it possible to configure nginx to make my server public? Also is it possible to make it accessible from local network?

Tags : nginx


Answers 1


Of course it can. If your server's ports are exposed to the public, then anyone can connect to your running services like nginx.

With the config file you have, listening on port 3000, and if your public.ip:3000 is forwarded (or NATed) to local.ip:3000, then anyone can access your nginx server by connecting to your.public.ip:3000. Anyone in your local network can also access your server, either by your.local.ip:3000 or your.public.ip:3000 (assuming you have internet connection in your local network).

Fanatique
Fanatique
September 14, 2018 15:53 PM

Related Questions


Nginx + PHP projects outside of root

Updated March 31, 2015 19:00 PM

Echoed Nginx Headers

Updated April 13, 2015 02:00 AM


How to install oauth on nginx

Updated July 16, 2015 16:00 PM

Prebuilt nginx default options (configuration)?

Updated May 29, 2017 14:01 PM