Skip to content

Commit ffdb60e

Browse files
authored
fix: enable IPv6 dual-stack for OSS, Plus, and unprivileged images (#483)
* Add IPv6 support to default.conf.template for OSS/Plus images The OSS and Plus base images were missing IPv6 support. The nginx base image's IPv6 enabler script modifies /etc/nginx/conf.d/default.conf, but the template processing (which runs after) overwrites this file, removing the IPv6 listen directive. This fix adds both IPv4 and IPv6 listen directives directly to the source template, ensuring they are present in the final configuration for OSS and Plus image variants. Fixes #453 Signed-off-by: Jesse Awan <[email protected]> * Add IPv6 support to unprivileged Docker image The unprivileged image needs to replace port 80 with port 8080 (since unprivileged users cannot bind to port 80). This fix modifies the sed commands to replace the port 80 listen directives (both IPv4 and IPv6) with port 8080 equivalents, ensuring dual-stack support without privilege issues. Fixes #339 Signed-off-by: Jesse Awan <[email protected]> --------- Signed-off-by: Jesse Awan <[email protected]>
1 parent ca5c7db commit ffdb60e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Dockerfile.unprivileged

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
FROM nginx-s3-gateway
77

88
# Implement changes required to run NGINX as an unprivileged user
9-
RUN sed -i "/^server {/a \ listen 8080;" /etc/nginx/templates/default.conf.template \
9+
RUN sed -i 's/listen[[:space:]]*80;/listen 8080;/g' /etc/nginx/templates/default.conf.template \
10+
&& sed -i 's/listen[[:space:]]*\[::\]:80;/listen [::]:8080;/g' /etc/nginx/templates/default.conf.template \
1011
&& sed -i '/user nginx;/d' /etc/nginx/nginx.conf \
1112
&& sed -i 's#http://127.0.0.1:80#http://127.0.0.1:8080#g' /etc/nginx/include/s3gateway.js \
1213
&& sed -i 's,/var/run/nginx.pid,/tmp/nginx.pid,' /etc/nginx/nginx.conf \

common/etc/nginx/templates/default.conf.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ js_set $awsSessionToken awscredentials.sessionToken;
3232
js_set $s3uri s3gateway.s3uri;
3333

3434
server {
35+
listen 80;
36+
listen [::]:80;
3537
include /etc/nginx/conf.d/gateway/server_variables.conf;
3638

3739
# Don't display the NGINX version number because we don't want to reveal

0 commit comments

Comments
 (0)