From 6f3489c9a39a3670e9fd4b4cdbc7202a11f85a51 Mon Sep 17 00:00:00 2001 From: Lee Harrold Date: Sun, 14 Apr 2024 11:06:25 -0400 Subject: [PATCH] tell flask app that incoming requests use HTTPS --- api/cloud/nginx.conf | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/api/cloud/nginx.conf b/api/cloud/nginx.conf index 105cd3a..f764999 100644 --- a/api/cloud/nginx.conf +++ b/api/cloud/nginx.conf @@ -49,23 +49,20 @@ http { add_header 'Content-Type' 'text/plain'; return 200 "nginx is healthy"; } - + location /api { proxy_pass http://localhost:5003/api; 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; - # Allow passing cookies to the backend + proxy_set_header X-Forwarded-Proto https; # Set to HTTPS since Nginx handles SSL termination proxy_set_header Cookie $http_cookie; proxy_http_version 1.1; - - proxy_read_timeout 20d; proxy_buffering off; } - + # frontend location / { root /app/frontend; @@ -90,14 +87,14 @@ http { } } + # backend server { listen 5003 default_server; listen [::]:5003 default_server; - # does localhost change to drive-gooder.com? - server_name localhost; + server_name drive-gooder.com; # Update to match your domain name root /var/www/html; - + location / { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.socket;