-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable IPv6 in Nginx if unsupported
Relates to #73
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# Based on /etc/docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, since the | ||
# same one cannot be used because the checksum of the default.conf differs. | ||
|
||
set -e | ||
ME=$(basename $0) | ||
|
||
# Disable IPv6 configuration if not supported or nginx is not installed | ||
# Added to resolve https://github.com/ckulka/baikal-docker/issues/73 | ||
if nginx -t 2>&1 >/dev/null | grep -q '\[emerg\] socket() \[::\]:80 failed (97: Address family not supported by protocol)'; then | ||
echo >&3 "$ME: info: Disable IPv6 in configuration" | ||
sed -i 's/listen \[::\]:80;/# listen \[::\]:80/' /etc/nginx/conf.d/default.conf | ||
fi |