Skip to content

Commit

Permalink
tell flask app that incoming requests use HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
seplee committed Apr 14, 2024
1 parent 241606a commit 6f3489c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions api/cloud/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 6f3489c

Please sign in to comment.