39 lines
927 B
Plaintext
39 lines
927 B
Plaintext
# Replace the host name and certificate paths before use.
|
|
upstream monitor_app {
|
|
server 127.0.0.1:10001;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name monitor.example.invalid;
|
|
|
|
ssl_certificate /etc/ssl/monitor/fullchain.pem;
|
|
ssl_certificate_key /etc/ssl/monitor/privkey.pem;
|
|
|
|
client_max_body_size 1024m;
|
|
|
|
location /static/ {
|
|
alias /opt/monitor/staticfiles/;
|
|
access_log off;
|
|
}
|
|
|
|
# Model files and generated private artifacts are never served as static files.
|
|
location /upload/ {
|
|
deny all;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://monitor_app;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name monitor.example.invalid;
|
|
return 301 https://$host$request_uri;
|
|
}
|