Nginx change port number for https

hello everyone
i’m running automated install on ubuntu and i want to chnage number port for https.
server is Nginx.
thinks

Hi @salah

You can change the port number in server{listen:value} in the nginx.conf file sudo nano /etc/nginx/nginx.conf

Whatever port you put in there will be the port users will need to use to access when they access the instance.

I hope this helps, if you need further support please provide more information. Thanks!

i can’t found it with comande line sudo nano /etc/nginx/nginx.conf :
Directory ‘/etc/nginx’ does not exist

1 Like

Where did you get the automated install from? Possibly it is using containers so nginx is not installed directly on the host system. Possibly in its own lxd container. If you can answer above we could help some more.

Also do you have a good reason to be changing the port from the default 443?

1 Like

Hello and thank you for your reply, I used the automatic installation on ubuntu from the link :

and I want to change the https port because port 443 is used by another web site and I want to know how to load the container service and thank you in advance.

1 Like

Great, thanks for providing more info. Based on @bobj response, I thought about searching for 443 number in the repository and it seems that needs a lot of configuration changes and things to consider. (Code search results · GitHub)[You need to be logged in to Github to view the search results]

You’ll probably need to update the port number in all of those files. (I’d wait for @bobj’s insights though :pray: )

Thanks!

Hi @salah . This is a bit of a tricky one to try and answer New years eve. When you use the container based install like you have indicated in the link (btw it is a very good way to install!) it is not normal that you would have additional services like another web server running in the host environment. Typically you want to keep your hypervisor host super clean with nothing much running beyond ufw, ssh daemon and the lxd containers. Any additional service you want to run, you would typically put it in its own new container. It is like keeping your desktop clean :-).

I don’t recommend you do what you are describing and we should add something in the docs to reflect that.

But if you really want to do it you need to understand the way that the 443 port is being routed through from the host to 443 in the nginx container. You should see the line that does this in /etc/ufw/before.rules. You can easily change that so that, say 444 on your host gets routed through to 443 on the container. Take a look and see,

As I say, this is not really what I would recommend, but it might be a useful exercise for you to do anyway to help understand what is going on. Join @tkipkurgat 's weekly Thursday calls for more discussion on these type of issue.

Best regards
Bob

1 Like

Hi @bobj,

I would like to install DHIS 2 using containers for personal practice on my laptop, but one of the prerequisites needed is qualified domain name (FQDN) as explained in dhis2-tools-ng.

Is there any way to proceed with installation using containers without FQDN on a personal laptop?

Thanks

If you use the new container based tooling at GitHub - dhis2/dhis2-server-tools: Tools to support installation and management of DHIS2 you can install without https and fqdn. @tkipkurgat is the expert if you get stuck.

Hi @tkipkurgat,

As I mentioned above, I would to install DHIS2 on my personal computer (laptop) using containers without FQDN for my practice. I looked at support tools as shared by Bob, but the steps mentioned are a bit confusing for me because I am not an expert. I was wondering if you could share simplified steps on how to install DHIS 2 using containers without FQDN and HTTPs.

Thanks in advance

Hi @fernando

Would you like to try installing using Docker Desktop instead? It’s the easiest and quickest option available.