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

Hostname not correctly added to ssl certificate #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN version=$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release) && \
apk add --no-cache --no-progress nginx && \
sed -i 's/#gzip/gzip/' /etc/nginx/nginx.conf && \
sed -i "/http_x_forwarded_for\"';/s/';/ '/" /etc/nginx/nginx.conf && \
sed -i "/http_x_forwarded_for/a \\\
sed -i "/http_x_forwarded_for/a \\ \
'\$request_time \$upstream_response_time';" \
/etc/nginx/nginx.conf && \
echo -e "\n\nstream {\n include /etc/nginx/conf.d/*.stream;\n}" \
Expand Down Expand Up @@ -45,4 +45,4 @@ EXPOSE 80 443
HEALTHCHECK --interval=60s --timeout=15s --start-period=120s \
CMD curl -Lk 'https://localhost/index.html'

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/nginx.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/nginx.sh"]
4 changes: 2 additions & 2 deletions nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ proxy_request_buffering() { local value="$1" \
# org) company
# Return: self-signed certs will be generated
gencert() { local domain="${1:-*}" country="${2:-NO}" state="${3:-Rogaland}" \
locality="${4:-Sola}" org="{5:-None}" dir=/etc/nginx/ssl
locality="${4:-Sola}" org="${5:-None}" dir=/etc/nginx/ssl
local cert="$dir/fullchain.pem" key="$dir/privkey.pem"
[[ -e $cert ]] && return
[[ -d $dir ]] || mkdir -p $dir
Expand Down Expand Up @@ -724,4 +724,4 @@ elif ps -ef | egrep -v 'grep|nginx.sh' | grep -q nginx; then
echo "Service already running, please restart container to apply changes"
else
exec nginx -g "daemon off;"
fi
fi