Jump to content

Nginx still listening on port 80 even though I changed web UI port


Recommended Posts

I changed Unraid's web UI ports to 81 and 444:

image.thumb.png.97ae2bd94ae7c9d4c4ce3f925bdacdf3.png

 

This usually works fine, however sometimes when I restart my system, Nginx decides to start listening on port 80 again, and to not listen via IPv6:

root@DanHome:/var/log# netstat -tunlp | grep nginx
tcp        0      0 0.0.0.0:81              0.0.0.0:*               LISTEN      10352/nginx: master
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10352/nginx: master
tcp        0      0 0.0.0.0:444             0.0.0.0:*               LISTEN      10352/nginx: master

 

restarting Nginx fixes it:

root@DanHome:/var/log# netstat -tunlp | grep nginx
tcp        0      0 127.0.0.1:81            0.0.0.0:*               LISTEN      19942/nginx: master
tcp        0      0 127.0.0.1:444           0.0.0.0:*               LISTEN      19942/nginx: master
tcp        0      0 10.1.1.12:444           0.0.0.0:*               LISTEN      19942/nginx: master
tcp        0      0 10.1.1.12:81            0.0.0.0:*               LISTEN      19942/nginx: master
tcp6       0      0 2001:5a8:415c:c400:::81 :::*                    LISTEN      19942/nginx: master
tcp6       0      0 2001:5a8:415c:c400::444 :::*                    LISTEN      19942/nginx: master
tcp6       0      0 ::1:444                 :::*                    LISTEN      19942/nginx: master
tcp6       0      0 ::1:81                  :::*                    LISTEN      19942/nginx: master

 

How do I prevent this from happening?

Diagnostics:

danhome-diagnostics-20231103-2141.zip

Link to comment

This may depend on your router / rtadvd / dhcpd6 config or speed.

 

It looks like at boot time your UNRAID does not get an IPV6 address (or the current prefix) fast enough before nginx is started.

 

your config says "use DHCPV6=yes", which is very uncommon in the real world. Almost nobody runs a DHCPV6 Server, so you may run into a timeout waiting for an answer that will never come. Try setting DHCPV6 to "no" and reboot. UNRAID will then try the most common SLAAC method to get a prefix and choose its own address. 

 

I bet, this will fix your problem

 

Link to comment
49 minutes ago, MrGrey said:

I'm not really strong on IPV6. I have it disabled. Bump? :)

 

MrGrey.

 

 

IPv6 is the future, and there's no real reason to disable it in 2023. Not having to deal with NAT makes a lot of things simpler. I also have some IPv6-only servers so I can't disable it otherwise I lose access to those servers.

Link to comment
5 minutes ago, MAM59 said:

your config says "use DHCPV6=yes", which is very uncommon in the real world. Almost nobody runs a DHCPV6 Server, so you may run into a timeout waiting for an answer that will never come. Try setting DHCPV6 to "no" and reboot. UNRAID will then try the most common SLAAC method to get a prefix and choose its own address. 

 

I'm actually using both. A regular public IPv6 address is assigned via SLAAC, however my ISP uses dynamic addresses and assigns me a different /56 range every time I connect, so I also use DHCPv6 to assign a ULA address so I have consistent IPv6 addresses internally, for servers.

 

I do see both addresses when I run `ip -6 a` on the Unraid server, but I'll try set DHCPv6 to "no" in Unraid and see if that helps.

 

Edited by Daniel15
Link to comment
8 minutes ago, Daniel15 said:

I'm actually using both.

I see, you know what you are doing, so my idea maybe useless.

But you cannot make UNRAID to use DHCPv6 and SLAAC at the same time. It's either stateful or stateless. Dynamic addresses should not be a problem anymore, there are DynDNS services to deal with this (also for V6 now and also for free).

I've used ULAs also for a while, but they gave me troubles now and then so I have dropped them. Also my router has an option for "use ULA until an prefix is assigned". This will use ULAs at boot time, but once the connection is complete, the real prefix is send and the ULA deleted.

(But at the end I got me a static /48 and assigned servers manually, using SLAAC for the clients)

 

Maybe for you it is enough to enter a delay of some seconds into the /boot/config/go file before you start up nginx ("emhttpd") ?

 

1 hour ago, MrGrey said:

I'm not really strong on IPV6. I have it disabled. Bump? :)

yeah, the earth is a disc...

I have disabled V4. Bump? 😇

Edited by MAM59
  • Upvote 1
Link to comment
  • 4 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...