SatelliteWP / rocket-nginx

Rocket-Nginx is a Nginx configuration that makes WP-Rocket even faster by serving static pages directly without loading WordPress or PHP.
MIT License
579 stars 129 forks source link

Error 502 when parameters #189

Closed LaurentLeLynx closed 1 year ago

LaurentLeLynx commented 1 year ago

Hello Maxime,

We have installed the last version of Rocket Nginx and are encountering some issues with url parameters. When there is a new query parameter in the url, the server returns a 502 error. Each time we need to exclude these parameters and add them in rocket-nginx.ini to make it work again. However this issue is quite annoying for us as we do not control all the parameters used by marketing teams and external partners. Is there a way to bypass rocket-nginx if unknown parameter ?

Versions Version of Rocket Nginx : 3.0.0 Version of Wp-Rocket : 3.12.0.5

Steps to reproduce the behaviour:

  1. Go to https://www.lelynx.fr/
  2. Add a random parameter in the url (for example ?parameter).
  3. See error

Thank you very much for your help,

Best regards

Laurent

maximejobin commented 1 year ago

I do not think this has to do with Rocket-Nginx. I see multiple headers that are displayed twice: image

Many of these headers do to come from Rocket-Nginx. I do not know if you are loading it multiple times but that can be something you should check.

The fact you have to add the parameter to the INI file does not make sense to me. The purpose of the parameters is to load the cached file or let WordPress handle it. It will not impact what is displayed. It's just the "how" we display it.

LaurentLeLynx commented 1 year ago

Hello Maxime,

Thanks for your quick answer. :) Unfortunately, I think it has to do with Rocket Nginx because when we don't use it, it works like a charm.

We updated a line in your default.conf file :

set $rocket_uri_path "";
if ($request_uri ~ "^([^?]*)(\?.*)?$") {
    set $rocket_uri_path $1$2;
}

By adding "$2" at the end of the $rocket_uri_path, it serves correctly Wordpress in the case of unknown url parameter.

So we will use this quick fix. Thanks for your help.

(for information we are loading 2 times rocket-nginx on some domains due to our proxy as we have multiples non-secured domains gathered under one secured).

Laurent

maximejobin commented 1 year ago

Loading the configuration twice is a bad idea. The proof is in the screenshot taken from your website:

image

I cannot agree that it has to do with Rocket-Nginx at this point. I cannot reproduce the issue on my end. The fact you are loading the configuration twice invalidates the investigation.

I'm glad you found a way to fix this but I'm really not convince by the fix.

Have a great day!