Nginx configuration for reverse proxy on multilingual WordPress (WPML) with Laravel: 502 error

I have a multilingual website built with Laravel and a multilingual WordPress blog (using WPML) in the "public" folder. I'm trying to configure Nginx as a reverse proxy to serve the blog on specific subdirectories for each language (e.g., lamamita.it/blog, lamamita.es/blog). I followed WPML's instructions and configured Nginx as shown in the attached example. However, when I access one of the blog subdirectories, I get a 502 error. What I've tried: Nginx configuration: I've carefully checked the syntax and settings of the location /blog/ block. Permissions: I've ensured that file and directory permissions are correct. Nginx logs: I've checked the Nginx logs for any errors or warnings. What I expect: I would like to understand why I'm getting the 502 error and how to correct the Nginx configuration to make the reverse proxy work correctly. Relevant code location /blog/ { proxy_pass https://www.lamamita.it:443/blog/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffer_size 16k; proxy_buffers 4 16k; } Additional information: Nginx version: 1.26.1 PHP version: 8.0 WordPress version: 6.6.2 WPML version: 4.6.13 Nginx error: 2024/09/18 15:01:53 [error] 1000837#1000837: *357241 upstream sent too big header while reading response header from upstream, client: 165.227.140.110, server: www.lamamita.es, request: "GET /blog/ HTTP/1.0", upstream: "https://165.227.140.110:443/blog/", host: "www.lamamita.es" Question: What other checks can I perform or what changes can I make to the Nginx configuration to fix this issue?

Comment (0)

You’ll be in good company