Skip to content

HTTP requests in docker local dev environment #7

Description

@mplusb

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/

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions