From 4feb39dfe349d737efc32a9e0ba7c8c29c7d7141 Mon Sep 17 00:00:00 2001 From: continuist Date: Sun, 21 Sep 2025 00:20:10 -0400 Subject: [PATCH] Try to fix connectivity issues --- deploy/prod-pod.yml | 5 ++--- nginx/nginx.conf | 41 +++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/deploy/prod-pod.yml b/deploy/prod-pod.yml index f5a1d16..8e6445d 100644 --- a/deploy/prod-pod.yml +++ b/deploy/prod-pod.yml @@ -73,7 +73,7 @@ spec: drop: ["ALL"] env: - name: DATABASE_URL - value: "postgres://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_PORT}/${POSTGRES_DATABASE_NAME}?sslmode=disable" + value: "postgres://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@127.0.0.1:${POSTGRES_PORT}/${POSTGRES_DATABASE_NAME}?sslmode=disable" - name: PORT value: "${PROD_BACKEND_PORT}" ports: @@ -162,7 +162,6 @@ spec: runAsGroup: 1000 ports: - containerPort: 8080 # inside pod - - containerPort: 8090 # health inside pod (not exposed) volumeMounts: - { name: nginx-run, mountPath: /var/run, readOnly: false } - { name: nginx-cache, mountPath: /var/cache/nginx, readOnly: false } @@ -171,7 +170,7 @@ spec: mountPath: /tmp # Health check livenessProbe: - httpGet: { path: /healthz, port: 8090, scheme: HTTP } + httpGet: { path: /healthz, port: 8080, scheme: HTTP } initialDelaySeconds: 10 periodSeconds: 30 # Resource limits diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 04ac524..8f1f271 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -15,34 +15,35 @@ http { uwsgi_temp_path /tmp/uwsgi_temp; scgi_temp_path /tmp/scgi_temp; - # health - server { - listen 8090; - location = /healthz { return 200 "ok\n"; add_header Content-Type text/plain; } - } - # public HTTP entrypoint (host will terminate TLS and proxy here) - server { + server { listen 8080; + # exact-match: wins over everything else in this server + location = /healthz { + access_log off; + add_header Content-Type text/plain; + return 200 "ok\n"; + } + # frontend default location / { - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Connection ""; - proxy_pass http://127.0.0.1:${PROD_FRONTEND_PORT}; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Connection ""; + proxy_pass http://127.0.0.1:${PROD_FRONTEND_PORT}; } # backend API location /api/ { - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Connection ""; - proxy_pass http://127.0.0.1:${PROD_BACKEND_PORT}/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Connection ""; + proxy_pass http://127.0.0.1:${PROD_BACKEND_PORT}/; + } } - } }