44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
# Include inside nginx's http context. Replace hostname and TLS certificate paths.
|
|
# The app port is bound to loopback; nginx is the only public entry point.
|
|
limit_req_zone $binary_remote_addr zone=taskmanager_login:10m rate=5r/m;
|
|
map $uri $taskmanager_loggable {
|
|
default 1;
|
|
~^/api/calendar/ 0;
|
|
}
|
|
server {
|
|
listen 80;
|
|
server_name tasks.example.org;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
server {
|
|
listen 443 ssl;
|
|
server_name tasks.example.org;
|
|
ssl_certificate /etc/letsencrypt/live/tasks.example.org/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/tasks.example.org/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
add_header Strict-Transport-Security "max-age=31536000" always;
|
|
client_max_body_size 11m;
|
|
client_body_timeout 15s;
|
|
access_log /var/log/nginx/taskmanager.log combined if=$taskmanager_loggable;
|
|
location ^~ /uploads/ { return 404; }
|
|
location = /api/health { return 404; }
|
|
location = /api/auth/callback/credentials {
|
|
limit_req zone=taskmanager_login burst=5 nodelay;
|
|
limit_req_status 429;
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
}
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
}
|