Really unclear on how proxies and ports work
Please complete the following:
Link to the page that needs to be updated or changed.
https://docs.lando.dev/config/proxy.html#proxy https://docs.lando.dev/config/services.html#localhost-assignment
Describe the change you'd like
This could be a sever lack of understanding on my part despite reading the docs with a fine tooth comb 🤣 however there could be a bug or two in here muddying my understanding.
There are a range of config options that I can not get my head around and I found the docs didn't accurately outline how they are intended to function, these config options are:
proxyport(nodespecific)sslscanneroverrides(this one is relatively clear I just think there are some caveats)moreHttpPorts
I have included my config below as well as my accompanying deductions about how these config options work.
Provided my understanding of these options is correct I would like to work towards improving there documentation as a whole as well as individually.
My configuration file
name: portfolio
proxy:
server:
- portfolio.lndo.site:5000
services:
server:
type: node
# port: 5000
ssl: true
# scanner: false
# Livereload port
moreHttpPorts:
- '35729'
overrides:
ports:
- '35729:35729'
run_as_root:
- chown node -R /certs
tooling:
npm:
service: server
node:
service: server
Console output when running the above configuration:
SERVER URLS http://localhost:35729
https://localhost:32797
http://portfolio.lndo.site/
https://portfolio.lndo.site/
Now from toggling things on and off here is what I get:
proxyseems to work as expected and theportfolio.lndo.siteURL's work perfectly when using it, however when I tried to remove theproxyand useport: 5000the website no longer renders, despite the fact thatportseems to be specifically enabled to help withnodeapps running on strange ports- Enabling
ssl: truecreates a URL with a random port every time I rebuild, in this casehttps://localhost:32797and logs it to the console scanner: falsedoes not disable the URL with the random port fromssl: truewhich based on it's description I thought it would haveoverridesmaps the port to my host machine without actually adding anything to the console (that is to say thatoverridesworks withoutmoreHttpPortsbut you get no output in the console)moreHttpPortssimply seems to log ports to the console on startup but doesn't actually work without theoverridesblock.- The URL's logged out by
moreHttpPortscan actually behttpsorhttpso perhaps it is worth just using//or no prefix at all?
If the above is correct or even partially correct it was the result of much commenting lines on and off in an attempt to distil how they operate together, I believe this could be better documented.