Skip to content

Commit

Permalink
Nginx with HTTPS + SSL termination
Browse files Browse the repository at this point in the history
  • Loading branch information
Rmarieta committed Jan 8, 2024
1 parent 0eabf45 commit d4fefb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ services:
# volumes:
# - ./nginx/conf.d:/etc/nginx/conf.d
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./nginx/ssl-certs:/etc/nginx/ssl-certs
# depends_on:
# - flask
13 changes: 12 additions & 1 deletion nginx/conf.d/server.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
server {
listen 80;
server_name _;
server_name localhost;

# redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name localhost;

ssl_certificate /etc/nginx/ssl-certs/localhost.crt;
ssl_certificate_key /etc/nginx/ssl-certs/localhost.key;

location / {
proxy_pass http://flask:5000/;
Expand Down

0 comments on commit d4fefb3

Please sign in to comment.