From 2352c2f375878d9efdac080c5d7716ecc242e8ed Mon Sep 17 00:00:00 2001 From: sedimentt Date: Mon, 24 Aug 2026 14:22:00 +0300 Subject: [PATCH] modif nginx --- docker-compose.yml | 2 +- nginx/nginx.conf | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3bb0efb..96fbabb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - /var/www/certbot:/var/www/certbot:ro - /etc/letsencrypt:/etc/letsencrypt:ro healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost/health"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1/health"] interval: 10s timeout: 5s retries: 3 diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 5a0d623..50f0f0d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -2,18 +2,23 @@ events {} http { server { - listen 80; + listen 80; + server_name api.sedimentt.site; - server_name api.sedimentt.site; + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } - location /.well-known/acme-challenge/ { - root /var/www/certbot; - } + location = /health { + access_log off; + return 200 "healthy\n"; + add_header Content-Type text/plain; + } - location / { - return 301 https://$host$request_uri; - } + location / { + return 301 https://$host$request_uri; } +} server { listen 443 ssl http2;