From 39c28001fa2cbf216c1810193647504b947b4131 Mon Sep 17 00:00:00 2001 From: Linden Crandall Date: Sat, 8 Feb 2025 07:17:22 +0900 Subject: [PATCH] removed http block --- .../nginx/automatisch_letsencrypt_nginx.conf | 29 ++++----- ...utomatisch_letsencrypt_nginx_template.conf | 29 ++++----- ...condary_automatisch_letsencrypt_nginx.conf | 64 +++++++++---------- 3 files changed, 57 insertions(+), 65 deletions(-) diff --git a/https/nginx/automatisch_letsencrypt_nginx.conf b/https/nginx/automatisch_letsencrypt_nginx.conf index 8bc9c53..addaa57 100644 --- a/https/nginx/automatisch_letsencrypt_nginx.conf +++ b/https/nginx/automatisch_letsencrypt_nginx.conf @@ -1,23 +1,20 @@ # initial nginx conf file needed when running certbot container the first time to generate ssl certs # replace with your DNS i.e.automatisch.lasthourhosting.org -http { +server { + + # nonstandard nginx http port + listen 7758; + listen [::]:7758; + server_name ; - server { + location / { - # nonstandard nginx http port - listen 7758; - listen [::]:7758; - server_name ; + # Forward to Automatisch site which is running on port 7757 + proxy_pass http://main:7757; + } - location / { - - # Forward to Automatisch site which is running on port 7757 - proxy_pass http://main:7757; - } - - location ~ /.well-known/acme-challenge/ { - root /var/www/certbot; - } - } + location ~ /.well-known/acme-challenge/ { + root /var/www/certbot; + } } \ No newline at end of file diff --git a/https/nginx/automatisch_letsencrypt_nginx_template.conf b/https/nginx/automatisch_letsencrypt_nginx_template.conf index 8bc9c53..addaa57 100644 --- a/https/nginx/automatisch_letsencrypt_nginx_template.conf +++ b/https/nginx/automatisch_letsencrypt_nginx_template.conf @@ -1,23 +1,20 @@ # initial nginx conf file needed when running certbot container the first time to generate ssl certs # replace with your DNS i.e.automatisch.lasthourhosting.org -http { +server { + + # nonstandard nginx http port + listen 7758; + listen [::]:7758; + server_name ; - server { + location / { - # nonstandard nginx http port - listen 7758; - listen [::]:7758; - server_name ; + # Forward to Automatisch site which is running on port 7757 + proxy_pass http://main:7757; + } - location / { - - # Forward to Automatisch site which is running on port 7757 - proxy_pass http://main:7757; - } - - location ~ /.well-known/acme-challenge/ { - root /var/www/certbot; - } - } + location ~ /.well-known/acme-challenge/ { + root /var/www/certbot; + } } \ No newline at end of file diff --git a/https/nginx/secondary_automatisch_letsencrypt_nginx.conf b/https/nginx/secondary_automatisch_letsencrypt_nginx.conf index 39d7e23..69cf04e 100644 --- a/https/nginx/secondary_automatisch_letsencrypt_nginx.conf +++ b/https/nginx/secondary_automatisch_letsencrypt_nginx.conf @@ -1,46 +1,44 @@ # nginx conf file to use after LetsEncrypt SSL certs have been created # replace with your DNS i.e.automatisch.lasthourhosting.org -http { - - server { + +server { - # nonstandard nginx http port - listen 7758; - listen [::]:7758; - server_name ; + # nonstandard nginx http port + listen 7758; + listen [::]:7758; + server_name ; - location ~ /.well-known/acme-challenge/ { - root /var/www/certbot; - } - - return 301 https://$host$request_uri; + location ~ /.well-known/acme-challenge/ { + root /var/www/certbot; } - server { + return 301 https://$host$request_uri; +} - # nonstandard nginx https port - listen 7759 ssl http2; - listen [::]:7759 ssl http2; +server { - # use ssl letsencrypt certs - ssl_certificate /etc/letsencrypt/live//fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live//privkey.pem; - server_name ; + # nonstandard nginx https port + listen 7759 ssl http2; + listen [::]:7759 ssl http2; + + # use ssl letsencrypt certs + ssl_certificate /etc/letsencrypt/live//fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live//privkey.pem; + server_name ; - location / { + location / { - # 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; - proxy_set_header X-Forwarded-Proto https; - } + # 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; + proxy_set_header X-Forwarded-Proto https; + } - location ~ /.well-known/acme-challenge/ { - root /var/www/certbot; - } - } -} \ No newline at end of file + location ~ /.well-known/acme-challenge/ { + root /var/www/certbot; + } +} \ No newline at end of file -- 2.47.2