Port forwarding address issues with WordPress + Docker + Codespaces, as of two weeks ago. #64633
Replies: 4 comments 3 replies
-
|
This is not a solution but an observation concerning the available environment variables. I too have been working on a setup that is loosely based on the WordPress Core Codespaces setup. I noticed that the Codespaces name & port forwarding domain environment variables don't exist within my PHP environment, they also seem not to be available properly during the container build process as the |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Onliner hammer eval FTW till in 2025... GenAI is not ready for this. environment:
WORDPRESS_CONFIG_EXTRA: $$site_domain = '${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}'; $$site_url = 'https://'.$$site_domain.'/'; define('WP_HOME', $$site_url); define('WP_SITEURL', $$site_url); $$_SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'; $$_SERVER['HTTP_HOST'] = $$site_domain;
Please add a sub chapter there [1] on "How to use this image on GitHub Codespace" :°°°D Refs |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Did something change and/or break with how port forwarding is handled on Codespaces in the last 2-3 weeks?
Background
I've had a pretty close to basic WP docker setup, that mostly adheres to the official
docker-compose.ymlsetup from WordPress. It's worked fine for months utilizing Codespaces on the web interface.wordpressservice has the ports set as:8080:80WP_HOMEURLandWP_SITEURLurl of:https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}docker compose up:8080in the running Codespace.${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}, and the site loads fine, lets me install WordPress, and login${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/any-page-title, and its worked fine all this time, for months without issue.The Problem
Two weeks ago: I spun up my Codespace, having changed no code from the last time it worked and now everything above works as described, EXCEPT for that last bit.
If I visit ANY frontend page route:
${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/any-page-title, I get automatically redirected to:${CODESPACE_NAME}-443.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/any-page-title, which is not the URL WordPress is running at.Investigation
:443as of versionv5.7if certain criteria is detected (which I believe this setup meets). However, I've been using versionsv6, v6.1, and v6.2for months with no issue whatsoever. So I thought perhaps the issue lay elsewhere.:80to test things further. And then when I tried to access a frontend in page at:${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/any-page-title, I instead get redirected to:${CODESPACE_NAME}-80.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/any-page-title, which is also NOT where WordPress's URL is set to run, but interestingly should have mapped to:8080automatically, right?Beta Was this translation helpful? Give feedback.
All reactions