An nginx server is up and running locally on my system[ubuntu 14.04]. But i am having difficulty accessing the same server from my public ip address, or from any other system using my public ip address. I have just started looking into nginx, its been great, but am stuck at this point now.

Issue : Nothing displays when i use my public ip address in the browser.

below is the config file "firstsite.com"

server {
        listen   80 default_server;
        server_name firstsite.com;

        root /var/www/uwsgiSite;
        index index.html;

        location / {
                try_files $uri $uri.html $uri/ index.html;
                allow all;

which is available in "sites-available" and soft linked into "sites-enabled" folders. Also i have an entry in the /etc/hosts file   firstsite.com

All the folders/files are available in /var/www with permission.

Later i would like to connect the same with a domain name [buy purchasing one] to my computer. For now, i am looking to make it work just with my public ip address, which is not working yet. I need to make it accessible.

2 Answers 2


The question is a little ambiguous, I am interpreting it to mean you have nginx running and configured to listen on the public IP your ISP gave you. You can see on the server that nginx is listening, but you can't hit it in any browser.

Your ISP does not allow just any traffic on your public IP. I believe you will need to look into port forwarding if you want to try to serve http(s) from the IP your ISP gave you.

  • I am using an airtel USB dongle. Anyway, was looking if there was any configuration missing. Or some security issues somewhere.
    – Archer
    Commented Mar 19, 2015 at 19:08

Have you forwarded the port for the server?

For your router to know which local ip address to redirect any traffic to a certain port to, you need to specify it first. Otherwise it wouldn't be clear what happens when you run multiple servers on different computers on the same local network.

How to specify port forwarding depends on your router. I can access the settings for mine by visiting my public ip address with a browser while on the local network, but it seems that that doesn't work for you.

  • I am using an airtel USB dongle. Anyway, was looking if there was any configuration missing. Or some security issues somewhere.
    – Archer
    Commented Mar 19, 2015 at 19:09
  • There's configuration missing, but I think it's not in your computer, or in your dongle. It's in your router, the device that manages the local network. You'll have to look up how to set up port forwarding on your model. It's probably not hard.
    – Ringstaart
    Commented Mar 19, 2015 at 19:15
  • Well, i think it is just a modem and not a router. By some googling i found out i can not port forward with this and it is taken care by the ISP. Also, found out that this 3G USB dongle may not be blocking any ports. Looking to find out if there was any other way.
    – Archer
    Commented Mar 19, 2015 at 19:20
  • In that case, I'm fairly sure it's impossible to set up a server that can be accessed from outside the local network (I might be wrong). Look into external hosting.
    – Ringstaart
    Commented Mar 19, 2015 at 19:28
  • yup, but not able to decide on a cheap/free hosting for nginx and uwsgi, with ssh support.
    – Archer
    Commented Mar 19, 2015 at 19:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .