37 lines
984 B
Plaintext
37 lines
984 B
Plaintext
limit_req_zone $binary_remote_addr zone=fluxip_auth:10m rate=5r/m;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name controller.example.com;
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name controller.example.com;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/controller.example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/controller.example.com/privkey.pem;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Request-Id $request_id;
|
|
proxy_read_timeout 180s;
|
|
|
|
location ~ ^/api/v1/auth/(login|setup)$ {
|
|
limit_req zone=fluxip_auth burst=3 nodelay;
|
|
limit_req_status 429;
|
|
proxy_pass http://127.0.0.1:8787;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8787;
|
|
}
|
|
}
|