Skip to content
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

HTTP requests in docker local dev environment #7

Open
mplusb opened this issue Apr 25, 2023 · 0 comments
Open

HTTP requests in docker local dev environment #7

mplusb opened this issue Apr 25, 2023 · 0 comments

Comments

@mplusb
Copy link

mplusb commented Apr 25, 2023

I’m using Docker for my development environment. I have an use case where my code (php-fpm container) and my webserver (nginx container) are separated in two different containers.

The plugins is triggering HTTP requests (debug-this.php L: 199) where it’s using the host from the get_bloginfo() function.

$url = get_bloginfo( 'url' ) . '/' . $wp->request . "?$query_string";

Since my code and therefore the plugin resides in a separate container it cannot create requests to http://localhost/ because the webserver is in another container. In order to perform the request it would have to send these requests to: http://nginx:80 (the docker service name if its in the same network)

Is it possible to provide an environment variable to set a HOST ourselfs?
query-monitor for example also provides actions of env variables: https://querymonitor.com/docs/configuration-constants/

https://wordpress.org/support/topic/http-requests-in-docker-local-dev-environment/

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

No branches or pull requests

1 participant