item-atlas/deploy/public/nginx.conf.template

48 lines
1.5 KiB
Plaintext

limit_req_zone $binary_remote_addr zone=atlas_native_session:1m rate=30r/m;
server {
listen 80;
server_name api-atlas.tutudog.com;
location ^~ /.well-known/acme-challenge/ {
root /etc/nginx/conf.d/.acme-api;
try_files $uri =404;
}
location / { return 308 https://api-atlas.tutudog.com$request_uri; }
}
server {
listen 443 ssl;
server_name api-atlas.tutudog.com;
ssl_certificate /etc/nginx/ssl/api-atlas.tutudog.com/current/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/api-atlas.tutudog.com/current/privkey.pem;
client_max_body_size 6m;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 5s;
proxy_read_timeout 90s;
location ^~ /api/admin/ { return 404; }
location ^~ /api/session/ {
client_max_body_size 4k;
limit_req zone=atlas_native_session burst=10 nodelay;
limit_req_status 429;
proxy_pass http://ATLAS_VISITOR_API;
}
location ^~ /api/ {
proxy_pass http://ATLAS_VISITOR_API;
}
location ^~ /auth/realms/item-atlas/ {
proxy_pass http://ATLAS_VISITOR_OIDC;
}
location ^~ /auth/resources/ {
proxy_pass http://ATLAS_VISITOR_OIDC;
}
location / { return 404; }
}