Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix server name for Mailman nginx configuration
Removed a hardcoded server name for the Mailman nginx configuration file
and replaced with logic to inject the server name based on environment
variable.
skoranda committed Oct 27, 2018
1 parent f0d42b1 commit a935a21
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comanage-registry-mailman/nginx/nginx.conf
@@ -59,13 +59,13 @@ http {

server {
listen 80;
server_name lists-dev.sphericalcowgroup.com;
server_name %%SERVER_NAME%%;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name lists-dev.sphericalcowgroup.com;
server_name %%SERVER_NAME%%;
ssl_certificate /etc/nginx/https.crt;
ssl_certificate_key /etc/nginx/https.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
4 changes: 4 additions & 0 deletions comanage-registry-mailman/nginx/start.sh
@@ -28,6 +28,7 @@ set -e
injectable_config_vars=(
MAILMAN_CORE_HOST
MAILMAN_CORE_PORT
SERVER_NAME
)

# Default values.
@@ -62,6 +63,9 @@ if [ -n "${NGINX_DH_PARAM_FILE}" ]; then
chown www-data /etc/nginx/dhparam.pem
fi

# Edit the nginx configuration file in place to set the server name.
sed -i -e s@%%SERVER_NAME%%@"${SERVER_NAME:-unknown}"@ /etc/nginx/nginx.conf

# Wait for the mailman core container to be ready.
until nc -z -w 1 "${MAILMAN_CORE_HOST}" "${MAILMAN_CORE_PORT}"
do

0 comments on commit a935a21

Please sign in to comment.