Team, I have a question about integrating saml on jenkins which is using nginx reverse proxy

So I followed this page https://www.youtube.com/watch?v=liaZpeTLDOc&t=1457s and I was unable to make it work with this configuration. But it works when I dont use the reverse proxy setup. After okta authentication it goes to the https://hostname/securityRealm/finishLogin and then it always goes to samlLogout page. Can you tell me why it is happening