-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for fix for loopback problem when port is mapped #2262
Comments
I would be willing to write up a draft for the docs if desired. |
I don't think I'm familiar with the problem you're describing that this fixes -- can you give a little more detail, please? |
Sorry not sure if this is the right place to discuss this. I just realized this is a repository for docs for many containers. This was meant to be specifically for the official wordpress docker container. I am referring to this same issue https://wordpress.org/support/topic/wordpress-docker-image/ I just found this though... maybe it could be a better solution. I haven't tested it though. |
Ah, specifically the combination of a non-standard expose port and WordPress trying to hit the "external" hostname to loop back to itself, and in development cases that being Yeah, maybe a blurb about this is warranted (perhaps with some of those links you've shared). I think |
you have. yes its a bit complicated. is this the correct place to discuss this then or would somewhere else be better? |
When the ports are mapped from the container's port 80 to another port wordpress has 2 problems:
"The REST API encountered an error"
"Your site could not complete a loopback request"
This has hindered me in development in certain occasions so I began searching for a workaround besides running it on port 80. I discovered that others have run into the same issue but no real solution. After a bit of digging I discovered that by editing the apache server config files to match the port that was set for the container I could fix the issue.
So in /etc/apache2/sites-enabled/000-default.conf
I added *:8080 to the first line
<VirtualHost *:80 *:8080>
then in /etc/apache2/ports.conf
just below
Listen 80
I added the line
Listen 8080
then after running
apachectl restart
everything now works as expected
I just wanted to mention this as it seems to be an unresolved minor issue that does have a fix… I assume that there would be an automated way to do this in using the docker file but I am not familiar enough with docker to do that.
The text was updated successfully, but these errors were encountered: