Public server with nginx

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?

1 Answer

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).

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like