Why Jenkins response Private(Internal) URL when it is called via public URL?

We are running the Jenkins Queue Job task. The task successfully triggers the build on Jenkins side but stuck at Job queued.

After checking the log, we found that when the job is created the task first access the Jenkins via Jenkins Public URL (http:// devops.) but when trying to get job task URL, Jenkins response the private URL (http:// cnap165.) . The private URL is set in the Jenkins. The Public URL is set in Azure DevOps pipeline,

Could you please help look into this issue and kindly let us know why Jenkins response Private(Internal) URL when it is called via public URL?

what is that screenshot? it doesn’t look like jenkins

the screenshot is from azure devops pipeline console. the azure devops call our jenkins instance from the domain name (http://devops.public.url) but got a private response url from jenkins (http://cnap165.private.url)

Jenkins has a url in the manage/configuration section. Its probably returning whatever you have entered there. I’m not sure why you’d expect jenkins to return something you didn’t configure.

In Jenkins.getRootUrl() (source), the configured URL overrides what is implied by the HTTP request.