バージョン : Jenkins 1.564
Jenkins さんだけ xxx.xxx.xxx.xxx:8080 とか野ざらしで可哀想…と思って Nginx のリバースプロキシ傘下に加えて http://hoge.hage.jp/jenkins とかでアクセスさせようと試みたのですがうまくいかない。何度やっても file not found 的な画面が出る。しかし Jetty が吐いているのはわかるのでおじさんまでは到達している。
そこで調べてみると http://www.phase2technology.com/blog/running-jenkins-behind-nginx/ に
To get Jenkins ready to run behind a reverse proxy, we’ll first want to have it stop binding to all interfaces and just have it bind to the local loopback address (127.0.0.1). This behavior is controlled by the httpListenAddress option in JENKINS_ARGS. Making Jenkins available at /jenkins is similarly controlled by the prefix argument in JENKINS_ARGS.
と書いてある。例としては
JENKINS_PORT="8080" JENKINS_ARGS="--prefix=/jenkins --httpListenAddress=127.0.0.1"
などとあって、この JENKINS_ARGS に --prefix=/jenkins
をセットしてあげれば良さげ。
肝心のファイルは jenkinsとapacheの連携 - Dev3TechHack にあるように /etc/sysconfig/jenkins
にありました。
おじさんが sysconfig なんかに設定持ってること知りませんでした。出直してきます。。
何はともあれこれで無事解決しました。