Warn about using a WordPress site host as the web server hostname (that also hosts that site)Β #446
Description
Terms
- I have read the guidelines for Contributing to Roots Projects
- This request is not a duplicate of an existing issue
- This is not a personal support request that should be posted on the Roots Discourse community
Summary
When a Trellis web server has a hostname assigned that is also used as the host of a WordPress site in that same web server, loopback connection problems occur.
(A loopback connection being a connection of that web server (commonly from inside the WordPress PHP app) to its own (public) host.)
As the /etc/hosts
has a default mapping of the server hostname to 127.0.0.1
, also at the very top (so it will always win when resolving the hostname on that system), the hostname on that system will always and immediately be resolved to (default IPv4 localhost) 127.0.0.1
.
nginx
on the Trellis web server listens on the public IP address(es) β also on localhost (127.0.0.1
), but isn't configured the same for localhost connections, TLS among other things. Therefore loopback connections for this host will fail.
It makes sense to add a warning to the Trellis documentation about using a hostname (as a domain) for the web server, that also one of its WordPress sites uses, as this will cause issues with loopback connections for that site domain.
Motivation
Why are we doing this?
Prevent issues with loopback connections, also helping with finding out about this issues for existing web server installations that already made that mistake.
What use cases does it support?
All use cases I am aware of.
What is the expected outcome?
Prevent this issue from occurring, also helping affected server admins.
Potential conflicts / foreseeable issues
No real conflicts. It should be very easy to set up a separate host name for the web server itself, like a subdomain (e.g. web-1.web-agency.tld
).
Additional Context
roots.io Discourse discussion where this issue was discovered:
https://discourse.roots.io/t/ssl3-read-bytes-tlsv1-unrecognized-name-downloading-domain-satispress-packages-json/24639/1