commit 2e5205b01c5ef57d67bb99a19012b18c3145e21b parent c4a20ccd6020ef694441300c31831fd7a6697985 Author: Henry Unite <unitehenry@gmail.com> Date: Wed, 1 Jul 2026 18:54:31 +0000 feat: nginx config 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:4090; + } + + location /guacamole { + proxy_pass http://127.0.0.1:8080/guacamole; + } + + listen 80; + } +}