Skip to main content
deleted 10 characters in body
Source Link

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 /cartsmy/add_to_cartpath, 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?

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 /carts/add_to_cart, 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?

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?

Source Link

NGINX Rate Limiting Configuration Leading to 404 Error for Specific Route in Plesk-Managed CakePHP App

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 /carts/add_to_cart, 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?