nginx fails to start when running a Geo setup with HTTPS
When running a Geo GDK setup (two GDK's running in parallel) with HTTPS enabled, I receive the following error:
nginx: [emerg] a duplicate listen 172.16.123.1:443 in /Users/ash/src/gdk/gdk-primary/nginx/conf/nginx.conf:42
With the nginx.conf
looking like:
worker_processes 1;
daemon off;
pid tmp/nginx.pid;
error_log stderr;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log logs/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
proxy_temp_path proxy_temp;
client_body_temp_path client_body_temp;
uwsgi_temp_path uwsgi_temp;
fastcgi_temp_path fastcgi_temp;
scgi_temp_path scgi_temp;
client_max_body_size 0;
upstream gitlab-workhorse {
server ee-primary.local:3333 fail_timeout=0;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen ee-primary.local:443 ssl;
ssl_certificate /Users/ash/src/gdk/gdk-primary/ee-primary.local+3.pem;
ssl_certificate_key /Users/ash/src/gdk/gdk-primary/ee-primary.local+3-key.pem;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 300;
proxy_pass http://gitlab-workhorse;
}
}
}
And line 42 being:
listen ee-primary.local:443 ssl;
For context, I run each GDK on it's own private IP 172.16.123.0/24
so they can listen on ports 80
and 443
without issue. 172.16.123.1
above is the Geo primary which is mapped to ee-primary.local
in my /etc/hosts
file.