Skip to content

Commit

Permalink
adição da configuração do ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
thisiscleverson committed Mar 29, 2024
1 parent 56bb0b3 commit e2f35dc
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
events {}

http {
access_log on;
sendfile on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

server {
listen 80;
server_name localhost;

listen [::]:80;

server_name $DOMAIN www.$DOMAIN;

location / {
proxy_pass http://app:5000;
proxy_pass http://$FLASK_SERVER_ADDR;
proxy_set_header Host $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;
}
}
}

server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name $DOMAIN www.$DOMAIN;

ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://$FLASK_SERVER_ADDR;
}

}
}

0 comments on commit e2f35dc

Please sign in to comment.