From a38151b7763fa58657aa8bf670153f9ea03660f9 Mon Sep 17 00:00:00 2001 From: Linden Crandall Date: Sat, 8 Feb 2025 06:46:37 +0900 Subject: [PATCH] updated nginx container ports --- docker-compose.yml | 8 ++++---- https/nginx/automatisch_letsencrypt_nginx.conf | 10 +++++++--- .../automatisch_letsencrypt_nginx_template.conf | 10 +++++++--- .../secondary_automatisch_letsencrypt_nginx.conf | 15 +++++++++------ 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f250ee4..8bb0906 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,8 +31,8 @@ services: - ./certbot/conf:/etc/letsencrypt - ./certbot/www:/var/www/certbot ports: - - ${PORT}:${PORT} - - ${PORT}:443 + - ${NGINX_HTTP_PORT}:${MAIN_HTTP_PORT} + - ${NGINX_HTTPS_PORT}:443 certbot: image: certbot/certbot:latest @@ -46,7 +46,7 @@ services: dockerfile: Dockerfile.compose entrypoint: /compose-entrypoint.sh ports: - - '${PORT}:${PORT}' + - '${MAIN_HTTP_PORT}:${MAIN_HTTP_PORT}' depends_on: postgres: condition: service_healthy @@ -55,7 +55,7 @@ services: environment: - HOST=${HOST} - PROTOCOL=${PROTOCOL} - - PORT=${PORT} + - PORT=${MAIN_HTTP_PORT} - APP_ENV=${APP_ENV} - REDIS_HOST=${REDIS_HOST} - POSTGRES_HOST=${POSTGRES_HOST} diff --git a/https/nginx/automatisch_letsencrypt_nginx.conf b/https/nginx/automatisch_letsencrypt_nginx.conf index 6cfca2e..45435ce 100644 --- a/https/nginx/automatisch_letsencrypt_nginx.conf +++ b/https/nginx/automatisch_letsencrypt_nginx.conf @@ -8,12 +8,16 @@ events { http { server { - listen 7757; - listen [::]:7757; + + # nonstandard nginx http port + listen 7758; + listen [::]:7758; server_name ; location / { - proxy_pass http://:7757; + + # Forward to Automatisch site which is running on port 7757 + proxy_pass http://main:7757; } location ~ /.well-known/acme-challenge/ { diff --git a/https/nginx/automatisch_letsencrypt_nginx_template.conf b/https/nginx/automatisch_letsencrypt_nginx_template.conf index 6cfca2e..45435ce 100644 --- a/https/nginx/automatisch_letsencrypt_nginx_template.conf +++ b/https/nginx/automatisch_letsencrypt_nginx_template.conf @@ -8,12 +8,16 @@ events { http { server { - listen 7757; - listen [::]:7757; + + # nonstandard nginx http port + listen 7758; + listen [::]:7758; server_name ; location / { - proxy_pass http://:7757; + + # Forward to Automatisch site which is running on port 7757 + proxy_pass http://main:7757; } location ~ /.well-known/acme-challenge/ { diff --git a/https/nginx/secondary_automatisch_letsencrypt_nginx.conf b/https/nginx/secondary_automatisch_letsencrypt_nginx.conf index 6e63b89..f23ecca 100644 --- a/https/nginx/secondary_automatisch_letsencrypt_nginx.conf +++ b/https/nginx/secondary_automatisch_letsencrypt_nginx.conf @@ -9,9 +9,9 @@ http { server { - listen 7757; - listen [::]:7757; - + # nonstandard nginx http port + listen 7758; + listen [::]:7758; server_name ; location ~ /.well-known/acme-challenge/ { @@ -23,8 +23,9 @@ http { server { - listen 7757 ssl http2; - listen [::]:7757 ssl http2; + # nonstandard nginx https port + listen 7759 ssl http2; + listen [::]:7759 ssl http2; # use ssl letsencrypt certs ssl_certificate /etc/letsencrypt/live//fullchain.pem; @@ -33,7 +34,9 @@ http { location / { - proxy_pass http://:7757/; + + # Forward to Automatisch site which is running on port 7757 + proxy_pass http://main:7757/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;