2021-12-16 12:54:15 +00:00
|
|
|
# You should change the server_name to something sensible.
|
|
|
|
# Also you need to specify the path to the ssl certificates.
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
# Enforce HTTPS
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
ssl_certificate /path/to/fullchain.pem;
|
|
|
|
ssl_certificate_key /path/to/privkey.pem;
|
|
|
|
ssl_trusted_certificate /path/to/fullchain.pem;
|
|
|
|
|
|
|
|
location / {
|
2023-01-13 18:36:26 +00:00
|
|
|
proxy_pass http://app:8000/;
|
2021-12-16 12:54:15 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|