The --public-addr CLI option gives the possibility for the user to pass to the node its external IP addresses.
The way it's implemented is that at startup we call libp2p::Swarm::add_external_address:
This, in turn, adds the address to the registry.
However, nodes continue to discover their (probably invalid) external IP address from other nodes.
Because of the way libp2p's Registry is implemented, the addresses passed with --public-addr will eventually get purged. This is obviously not supposed to happen.
The detection is automatically done in libp2p-identify, so Substrate can't disable it.
There seems to be lacking a way in libp2p to implement something like --public-addr.
cc @mxinden @romanb
For some history: --public-addr was implemented a long time ago when addresses stayed in the libp2p Registry forever.
But we then changed its behaviour to purge old addresses, and didn't think of --public-addr.
I can look into this on the libp2p side.
@ddorgan The problem with nodes behind nginx not receiving incoming connections should now be fixed.
Good news, thanks @tomaka