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

Docker nginx config only binds to ipv4 not ipv6 #8437

Closed
Southclaws opened this issue Mar 1, 2023 · 2 comments · Fixed by #8438
Closed

Docker nginx config only binds to ipv4 not ipv6 #8437

Southclaws opened this issue Mar 1, 2023 · 2 comments · Fixed by #8438
Assignees
Labels
docker Pull requests that update Docker code type: enhancement

Comments

@Southclaws
Copy link
Contributor

listen 8080;

I ran into a networking issue when deploying to Fly.io and it turns out the cause was the nginx instance serving Swagger-UI wasn't binding to all ipv6 interfaces, only ipv4.

https://community.fly.io/t/private-networking-internal-domain-not-working-for-one-service/11096/7

It seems the solution is to simply add another listen directive:

listen 8080;
listen [::]:8080;

I can open a PR for this if needed. I need to fork the repo anyway in order to get Swagger-UI working in our Fly.io internal VPN.

Southclaws added a commit to Southclaws/swagger-ui that referenced this issue Mar 1, 2023
@char0n char0n self-assigned this Mar 6, 2023
@char0n char0n added type: enhancement docker Pull requests that update Docker code labels Mar 6, 2023
@char0n
Copy link
Member

char0n commented Mar 7, 2023

In the light of #8447, I've issued #8449. The change that we've introduced in #8438 is backward incompatible.

The PR #8449 makes the change backward compatible by disabling listen directive for IPv6 by default and with possibility to turn it on with PORT_IPV6 env variable.

Example usage:

set PORT_IPV6=8088

This will add following line to nginx config:

listen            [::]:8088;

char0n added a commit that referenced this issue Mar 7, 2023
Enabling IPv6 address and port for IPv6 addresses
caused backward incompatible issues in the docker image.
If one wants to use it, it must be turned on explicitly
with PORT_IPV6 env variable.

Refs #8447
Refs #8437
@Southclaws
Copy link
Contributor Author

Thanks for this! Forgot some environments don't support ipv6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants