2020-05-18 03:20:51 +00:00
|
|
|
upstream web {
|
|
|
|
server web:8000;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2020-10-16 19:55:32 +00:00
|
|
|
listen [::]:80;
|
2020-05-18 03:20:51 +00:00
|
|
|
listen 80;
|
|
|
|
|
2020-10-16 19:55:32 +00:00
|
|
|
server_name your-domain.com www.your-domain.com;
|
|
|
|
|
|
|
|
location ~ /.well-known/acme-challenge {
|
|
|
|
allow all;
|
|
|
|
root /var/www/certbot;
|
|
|
|
}
|
|
|
|
|
2021-03-12 22:15:53 +00:00
|
|
|
# redirect http to https
|
|
|
|
return 301 https://your-domain.com$request_uri;
|
2020-10-16 19:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
listen 443 ssl http2;
|
|
|
|
|
|
|
|
server_name your-domain.com;
|
|
|
|
|
|
|
|
# SSL code
|
|
|
|
ssl_certificate /etc/nginx/ssl/live/your-domain.com/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/nginx/ssl/live/your-domain.com/privkey.pem;
|
|
|
|
|
2021-01-02 20:14:51 +00:00
|
|
|
location ~ /.well-known/acme-challenge {
|
|
|
|
allow all;
|
|
|
|
root /var/www/certbot;
|
|
|
|
}
|
|
|
|
|
2020-05-18 03:20:51 +00:00
|
|
|
location / {
|
|
|
|
proxy_pass http://web;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_redirect off;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /images/ {
|
|
|
|
alias /app/images/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /static/ {
|
|
|
|
alias /app/static/;
|
|
|
|
}
|
|
|
|
}
|