{"id":144,"date":"2022-07-23T10:58:16","date_gmt":"2022-07-23T10:58:16","guid":{"rendered":"https:\/\/blog.simulakrum.diskstation.eu\/?p=144"},"modified":"2022-07-23T11:00:21","modified_gmt":"2022-07-23T11:00:21","slug":"nginx-reverse-proxy-for-a-jenkins-in-nomad-issue","status":"publish","type":"post","link":"https:\/\/blog.simulakrum.vpndns.org\/?p=144","title":{"rendered":"NginX reverse proxy for a Jenkins in Nomad issue"},"content":{"rendered":"\n<p>I&#8217;ve moved a Jenkins instance from a dedicated node into a Nomad cluster ran as a docker, and had a very strange issue with redirections: most of the locations worked, but clicking on &#8220;\/manage&#8221; would lead to &#8220;https:\/\/jenkins\/manage&#8221; instead of &#8220;https:\/\/jenkins.fqdn\/manage&#8221;, breaking the URL of course. <br><br>I could not find a root cause in either Internet-facing load-balancer, nor in internal load-balancers, consul-template configurations, or very nomad jobs. <br><br>A workaround turned out to be a hard-coding line in the configuration of the first in the line, Internet-facing load balancer (NginX) <\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code has-small-font-size\"><code># grep proxy_redirect \/etc\/nginx\/sites-enabled\/jenkins | tail -1\n      \tproxy_redirect\t\thttps:\/\/jenkins\/ https:\/\/jenkins.simulakrum.diskstation.eu\/;<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<p> That solved it for all of the URLs for alpine-based Jenkins-in-Docker ran in Nomad.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve moved a Jenkins instance from a dedicated node into a Nomad cluster ran as a docker, and had a very strange issue with redirections: most of the locations worked, but clicking on &#8220;\/manage&#8221; would lead to &#8220;https:\/\/jenkins\/manage&#8221; instead of &#8220;https:\/\/jenkins.fqdn\/manage&#8221;, breaking the URL of course. I could not find a root cause in either Internet-facing load-balancer, nor in internal &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":2,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.simulakrum.vpndns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}