40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name flask.example.com;
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name flask.example.com;
|
|
client_max_body_size 10G;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/flask.example.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/flask.example.com/privkey.pem; # managed by Certbot
|
|
ssl_dhparam /etc/nginx/ssl-dhparams.pem; # managed by Certbot
|
|
include /etc/nginx/ssl.conf; # managed by Certbot
|
|
|
|
location = /robots.txt {
|
|
alias /var/www/app/flask/staticfiles/robots.txt;
|
|
}
|
|
location = /favicon.ico {
|
|
alias /var/www/app/flask/staticfiles/favicon.ico;
|
|
}
|
|
|
|
location /static {
|
|
expires max;
|
|
alias /var/www/app/flask/staticfiles;
|
|
}
|
|
|
|
location /media {
|
|
#expires max;
|
|
proxy_max_temp_file_size 0;
|
|
proxy_buffering off;
|
|
alias /var/www/app/flask/media;
|
|
}
|
|
location / {
|
|
include /etc/nginx/proxy_params;
|
|
proxy_pass http://flask:5000/;
|
|
}
|
|
} |