Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

MatthiasJobst
Copy link

@MatthiasJobst MatthiasJobst commented Aug 16, 2023

Add --noproxy for localhost to prevent from using a proxy for this request

Describe the pull request

This PR fixes #7529.

When the environment variables HTTP_PROXY and/or HTTPS_PROXY are set, the routing even for localhost goes through the proxy. In cases where the docker image uses a port redirection this request fails.
When accessing itself as a host a proxy is not really needed so this is disabled in the HEALTHCHECK.

Link to the issue: #7529

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan.

Test plan

This fix can be verified by starting a docker container with the following additional parameters: -e HTTP_PROXY=host.docker.internal -e HTTPS_PROXY=host.docker.internal. When this fix is not present a docker inspect or a docker ps will show the container as unhealthy. With this fix the container is healthy.

A command for verification could look like this:

docker run -d -e HTTP_PROXY=host.docker.internal -e HTTPS_PROXY=host.docker.internal --name gogs_test gogs/gogs:latest

docker ps gogs_test

Add --noproxy for localhost to prevent from using a proxy for this request
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.

Docker health check is not working when using a proxy

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.