1

I'm using Plesk 18 with NGINX as a proxy in front of Apache2 for a CakePHP application. I have set up rate limiting in my NGINX configuration (/etc/nginx/nginx.conf) with limit_req_zone $binary_remote_addr zone=mylimit:10m rate=5r/s;. I want to apply this rate limit specifically to a route /my/path, which is defined in CakePHP as follows: $routes->connect('/my/path', ['controller' => 'My', 'action' => 'path']);.

However, when I add the following additional NGINX directive in Plesk:

location /my/path { limit_req zone=mylimit burst=10 nodelay; proxy_pass https://PUBLIC-SERVER-IP:PORT; } 

I receive a 404 error for that route, which otherwise works fine without this NGINX configuration. My goal is to also eventually block IPs that exceed the rate limit for a specified duration. How can I correctly configure NGINX to apply rate limiting to this route without causing a 404 error, ensuring requests are properly forwarded to Apache?

1
  • Voting to move to a different area as Plesk, like most management UI packages, does funky, Plesk-specific things to the server config. Commented Mar 17, 2024 at 17:16

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.