commit e653f121abb305825c48ed5eae75f6d8bbd59b22 parent 22847da47f3626ac6bab856dfc504a68cf482871 Author: Henry Unite <unitehenry@gmail.com> Date: Mon, 20 Jul 2026 00:45:06 +0000 feat: nginx conf Diffstat:
| A | nginx/nginx.conf | | | 31 | +++++++++++++++++++++++++++++++ |
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/nginx/nginx.conf b/nginx/nginx.conf @@ -0,0 +1,31 @@ +events {} + +http { + limit_req_zone $limit_key zone=unauth:10m rate=5r/s; + + map $remote_user $limit_key { + default $binary_remote_addr; # No valid user -> rate limit by IP + "" $binary_remote_addr; # Explicit empty + ~^. ""; # Any non-empty $remote_user -> skip limit + } + +server { + server_name example.com; + + auth_basic "Restricted Area"; + auth_basic_user_file /etc/nginx/.htpasswd; + + limit_req zone=unauth burst=10 nodelay; + limit_req_status 429; + + location / { + proxy_pass http://127.0.0.1:4096; + } + + location /guacamole { + proxy_pass http://127.0.0.1:8080/guacamole; + } + + listen 80; + } +}