This commit is contained in:
Yuri-Lima
2025-09-24 15:58:23 +02:00
parent c1ce709c41
commit 414e40619f
5 changed files with 166288 additions and 29 deletions

View File

@@ -7,11 +7,11 @@ events {
http {
# ## Track by client IP; 20MB ≈ ~1200 active IPs
limit_req_zone $binary_remote_addr zone=rl_zone:20m rate=50r/s;
# Return 429 instead of 503 when throttled
limit_req_status 429; # 429 is the HTTP status code for Too Many Requests
# Log 429s at warn (not error)
limit_req_log_level warn;
# limit_req_zone $binary_remote_addr zone=rl_zone:20m rate=50r/s;
# # Return 429 instead of 503 when throttled
# limit_req_status 429; # 429 is the HTTP status code for Too Many Requests
# # Log 429s at warn (not error)
# limit_req_log_level warn;
geo $frontend_whitelist {
default 1;
@@ -63,7 +63,7 @@ http {
zone pgadmin4-ui 64k;
least_conn;
server pgadmin4-ui:80 resolve fail_timeout=120s max_fails=20;
server 127.0.0.1:81 backup; # Backup server for unavailable service
# server 127.0.0.1:81 backup; # Backup server for unavailable service
# ADD_PGADMIN4_SERVERS_HERE
}
@@ -141,7 +141,7 @@ http {
listen 127.0.0.1:81;
server_name _;
limit_req zone=rl_zone burst=30 nodelay;
# limit_req zone=rl_zone burst=30 nodelay;
# Return service unavailable for health checks
location /health {
@@ -174,7 +174,7 @@ http {
listen 80;
server_name _;
limit_req zone=rl_zone burst=30 nodelay;
# limit_req zone=rl_zone burst=30 nodelay;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
@@ -279,6 +279,9 @@ http {
# include /etc/nginx/includes/*.conf;
location /pgadmin4 {
error_log /var/log/nginx/pgadmin4_error.log notice;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://pgadmin4-ui/;
proxy_set_header X-Script-Name /pgadmin4;
@@ -395,7 +398,7 @@ http {
server_name _;
# Apply globally inside this server
limit_req zone=rl_zone burst=30 nodelay;
# limit_req zone=rl_zone burst=30 nodelay;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;