Jenkins css and js not loading via Nginx reverse proxy

Here Jenkins serving the application through the Nginx reverse proxy server with the following configuration.

location ^~ /jenkins/ {
                proxy_pass http://127.0.0.1:8080/;
        }

In this case Jenkins loading as broken as all the css and js pages are throwing 404 error.

We can resolve this problem by adding the prefix in Nginx reverse proxy configuration.

location ^~ /jenkins/ {
                proxy_pass http://127.0.0.1:8080/jenkins/;
        }

Then restart the Nginx service.

#systemctl restart nginx

That's all…