While I see options there to get around the permissions issue, it seems like it makes more sense to use NGINX reverse proxy to solve this issue. Then, I think, I can also do things like redirect requests on port 80 to 443, or perhaps accept requests both ways. Neither of which I believe I can do with Node-RED alone.
I run into trouble when I try to sudo apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nginx : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable
E: Unable to correct problems, you have held broken packages.
I'm unsure if it's related, but when I sudo apt update, I get a couple 404s:
Hit:1 http://ca-central-1.ec2.ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ca-central-1.ec2.ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ca-central-1.ec2.ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 https://deb.nodesource.com/node_12.x focal InRelease
Ign:5 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Hit:8 http://nginx.org/packages/ubuntu xenial InRelease
Err:9 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
404 Not Found [IP: 91.189.95.85 80]
Ign:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Get:11 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [310 kB]
Ign:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Err:10 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
404 Not Found [IP: 91.189.88.152 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I am at my PC now and looked at your output more carefully. Your sources list is a complete mess. You are running Ubuntu 20.04 (which is focal), but you have a xenial (16.04) source for nginx (that is no doubt the primary reason for the nginx install problem) and a whole set of bionic ones (18.04). Finally the certbot ppa you have specified does not support 20.04. I suggest you edit your sources list and start by getting rid of all the xenial and bionic ones and then try sudo apt update sudo apt full-upgrade
and then see where that gets you.
Once everything else is sorted then you can look at the certbot ppa. Why are you using that?
Good questions. Although I don't know the answers you inspired me to blow it up and start over using @meeki007's tutorial, which is really excellent and way better than the resources I was trying to follow the first time.
Awesome! glad its working. Thanks Colin for stepping in when i was away.
Hey Breaking things "blow it up and start over" is how I learn 90% of the stuff I'm working on. Now and again I think back to times before and the amount of resources/time lost because you could not just delete a line or reinstall.
Well I'll just throw away 10,000 copies of that pamphlet because it was printed on green paper stock instead of red.
#Forwards the real visitor remote IP address to the proxied server
proxy_set_header X-Real-IP $remote_addr;
in the nginx hosts is for.
node-red, dashboard, and worldmap all support this. using the stock node-red look in the msg.[somting?].headers section to see the ip of the user connected.
as for other nodes they may or may not handle proxy correctly.
Update:
msg.req.headers["x-real-ip"] is what your looking for.