@@ -0,0 +1,46 @@
|
||||
# Copy into /etc/nginx/sites-available/dilib-dashboard after replacing hostname and cert paths.
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
limit_req_zone $binary_remote_addr zone=dilib_login:10m rate=10r/m;
|
||||
server {
|
||||
listen 80;
|
||||
server_name dashboard.example.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name dashboard.example.com;
|
||||
ssl_certificate /etc/letsencrypt/live/dashboard.example.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/dashboard.example.com/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
client_max_body_size 2m;
|
||||
add_header X-Content-Type-Options nosniff always;
|
||||
location /static/ { alias /opt/dilib-dashboard/staticfiles/; }
|
||||
location = /api/auth/login/ {
|
||||
limit_req zone=dilib_login burst=10 nodelay;
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location ~ ^/(api|admin)/ {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_read_timeout 75s;
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
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 3600s;
|
||||
proxy_buffering off;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user