1

I am hosting a web application via a home server. I have my Cloudflare DNS A record pointed to my public ip and my firewall is off. I am using cloud flare for SSL.

My app is running on local host (127.0.0.1) port 1624.

I am using nginx. My server name is my public ip and listen is port 80.

My reverse proxy is pointed at 127.0.0.1:1624. I have port 80 open on my router as well.

For some reason I am not able to connect to my website. What could be causing this?

The developer of the web app has told me to use my domain name for the server name and keep the port as default 80 while pointing the reverse proxy to 127.0.0.1:1624.

My nginx conf:

server 
{
    server_name {mypublicip};
    #server_name {mydomainname};
    listen       80;

    location / {
            proxy_pass http://127.0.0.1:1624; # my web app proxy

            proxy_http_version 1.1;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }

    #error_page  404              /404.html;
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

}

Router Settings: Router Settings

I've tried:

Nginx conf -

  • server_name > domain NAME
  • server_name > public ip

My app is working when I go to 127.0.0.1:1624 just not my domain.

2
  • Show us your nginx config Commented Feb 17, 2023 at 9:01
  • @AlekseyVaganov Here is a pastebin with my conf. I switched my ip and domain name just for privacy. The proper entries are there. pastebin.com/aKMTYHXt Commented Feb 17, 2023 at 13:28

1 Answer 1

0

You should configure port forwarding on your router - so that all packets coming on port 80 of the public IP on your router will be forwarded to port 80 of your local PC (which probably has an internal IP address in a 192.168.xx.yy range). Then your nginX should listen on port 80 at that 192.168.xx.yy address on your PC and proxy_pass to 127.0.0.1:1624 where your application is listening.

IF you don't do this - packets will end up on the router instead of at nginX in your local PC.

Sign up to request clarification or add additional context in comments.

2 Comments

So in my router settings, instead of public ip i put my internal ip?
Such a simple error. Thank you so much. I changed out my public ip for my internal and it works fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.