How to access nginx server from outside using specific port (4430)

Hello,

I’m trying to deploy a Flask app using nginx server. This server is hosted on one of my computers with an ubuntu system and using my internet connexion.

I managed to deploy the app and access it via my local network but not with others network. In order to do so, I tried to configure my box to allow remote access which is possible only through the port 4430.

Therefore I can pass the following test with success (using the port 4430): https://canyouseeme.org/

My nginx configuration is the following one:

server {
    listen 80;
     listen [::]:80;
root /var/www/domain.app/html;
index index.html index.htm index.nginx-debian.html;

server_name domain.app www.domain.app;

location / {
        try_files $uri $uri/ =404;
}

}

The app is still not accessible from others network when trying domain.app:4430 and I’m a bit confused about the manipulation needed in order to solve this issue.

I tried to change the nginx configuration file with port 4430 instead of 80 -> not working
I get “your connexion is not secure … NET_CERT_AUTHORITHY_INVALID”

I also tried to add a Self-signed SSL Certificate for Nginx using the following command:
sudo certbot --nginx -d domain.app -d www.domain.app

but I then get: “Timeout during connect (likely firewall problem)”

I’m quite new to that topic and any help would be very appreciated.

Hi @lou1

to validate your domain using http validation, a working port 80 is required. Perhaps with a redirect to another port 80 or 443, no other port.

Please start with some basics.

Then read something about challenge types:

That

doesn't create a self signed certificate.

1 Like

@lou1 I’m not so sure from your story what the actual issue is here. Do you have trouble getting a Let’s Encrypt certificate? Or are you having trouble with installing a Let’s Encrypt certificate? Or is it more a “general” “how do I get nginx to work on another port” issue? Or perhaps a “how do I get my Flask app to do something” issue? Note: the latter two issues aren’t really issues discussed here on this forum if it doesn’t involve Let’s Encrypt. At least not in the “Help” section.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.