Skip to content

Add WordPress sites to /etc/hosts#1606

Merged
retlehs merged 1 commit intomasterfrom
update-hosts-file-with-wordpress-sites
Sep 27, 2025
Merged

Add WordPress sites to /etc/hosts#1606
retlehs merged 1 commit intomasterfrom
update-hosts-file-with-wordpress-sites

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Sep 27, 2025

This PR creates a hosts role that automatically adds all configured WordPress site domains to /etc/hosts with 127.0.0.1

@retlehs retlehs requested a review from swalkinshaw September 27, 2025 23:03
@retlehs retlehs self-assigned this Sep 27, 2025
@retlehs retlehs merged commit fbcc20f into master Sep 27, 2025
2 checks passed
@retlehs retlehs deleted the update-hosts-file-with-wordpress-sites branch September 27, 2025 23:32
@strarsis
Copy link
Contributor

strarsis commented Sep 28, 2025

@swalkinshaw, @retlehs: From the back of my head I remembered an issue that occurs exactly when a WordPress site hostname in Trellis resolves to 127.0.0.1: https://discourse.roots.io/t/ssl3-read-bytes-tlsv1-unrecognized-name-downloading-domain-satispress-packages-json/24639/52?u=strarsis and roots/docs#446 - Does this also apply to the localhost records added by this PR?

@retlehs
Copy link
Member Author

retlehs commented Sep 28, 2025

@strarsis Great memory and thanks for pointing this out

Does this also apply to the localhost records added by this PR?

Looks like it! Maybe we should scope this to development servers only?

@strarsis
Copy link
Contributor

strarsis commented Sep 28, 2025

Looks like it! Maybe we should scope this to development servers only?

Is HTTPS/TLS used for Trellis development environment?

The underlying issue is that the nginx configuration for localhost is different to the one for its public IP.
When nginx can be configured to also listen on localhost/127.0.0.1 and not just public IP for the wordpres sites (if possible with nginx configuration), then resolving to 127.0.0.1 should not be a problem anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants