When running Jenkins behind an Nginx reverse proxy, you might encounter this error:

It appears that your reverse proxy set up is broken.

The fix

The key detail that trips most people up: the proxy addresses in your Nginx configuration must NOT include a trailing slash.

server {
    listen 80;
    server_name jenkins.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;  # No trailing slash!
        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;
    }
}

Make sure the proxy_pass URL does not end with /. That small detail is the difference between a working reverse proxy and the broken setup error.