问题
I have a Jenkins server on my local Windows device, but I want to make it invisible to the outside world (office rules regarding servers). The obvious and unsubtle way, which works satisfactorily, is to set up a firewall rule to block incoming access to its port, but I feel there must be a Jenkins setting to stop it advertising its services to anyone but localhost. Can anyone tell me if there is?
Note that setting up user credentials is not a valid solution, as the server being visible but inaccessible without login still violates office rules.
回答1:
From Starting and Accessing Jenkins you need --httpListenAddress=127.0.0.1
command line parameter:
--httpListenAddress=$HTTP_HOST - Binds Jenkins to the IP address represented by $HTTP_HOST. The default is 0.0.0.0 — i.e. listening on all available interfaces. For example, to only listen for requests from localhost, you could use: --httpListenAddress=127.0.0.1
If you run your Jenkins as Windows service, you can extend command line arguments in jenkins.xml
file in Jenkins home directory.
Similar answer (for Linux-oriented platforms) on ServerFault.
来源:https://stackoverflow.com/questions/31779993/make-jenkins-invisible-to-remote-users