unable to login to jenkins(Unlock Jenkins) unable to login to jenkins(Unlock Jenkins) jenkins jenkins

unable to login to jenkins(Unlock Jenkins)


in my case the Jenkins was not unlocking with initial Admin password, then I thought of setting it up initially with Apache and then proceed with fixing the problem . The problem was in the number of slashes you put after ProxyPass and ProxyPassReverse entries.

Wrong entries

ProxyRequests     OffProxyPreserveHost On<Proxy http://localhost:8081/jenkins*>   Order deny,allow   Allow from all</Proxy>ProxyPass /jenkins http://localhost:8081/jenkins/ nocanonAllowEncodedSlashes NoDecodeProxyPassReverse /jenkins http://localhost:8081/jenkins/ProxyPassReverse /jenkins http://your.hostname.domain/jenkins/RequestHeader set X-Forwarded-Proto "https"RequestHeader set X-Forwarded-Port "443"

Correct one which worked.

ProxyRequests     OffProxyPreserveHost On<Proxy http://localhost:8081/jenkins*>   Order deny,allow   Allow from all</Proxy>ProxyPass /jenkins http://localhost:8081/jenkins nocanonAllowEncodedSlashes NoDecodeProxyPassReverse /jenkins http://localhost:8081/jenkinsProxyPassReverse /jenkins http://your.hostname.domain/jenkinsRequestHeader set X-Forwarded-Proto "https"RequestHeader set X-Forwarded-Port "443"

Let me know your thoughts.


use instructions from https://github.com/geerlingguy/ansible-role-jenkins/issues/50#issuecomment-214935354 and check an update below regarding locking access for anonymous users - worked for me today.

Shamelessly stolen from the link above:

  1. Create the file /var/lib/jenkins/jenkins.install.UpgradeWizard.statewith one line 2.0
  2. Create the file/var/lib/jenkins/init.groovy.d/basic-security.groovy with thecontents:

    #!groovy

    import jenkins.model.*import hudson.security.*

    def instance = Jenkins.getInstance()

    println "--> creating local user 'admin'"

    def hudsonRealm = new HudsonPrivateSecurityRealm(false)hudsonRealm.createAccount('admin','admin')instance.setSecurityRealm(hudsonRealm)

    def strategy = new FullControlOnceLoggedInAuthorizationStrategy()instance.setAuthorizationStrategy(strategy)instance.save()


you should deploy your jenkins to ......./tomcat/webapps/rootthen the jenkins url should like 'http://localhost:8080/login?from=%2F',when it is done,just copy code in the file ..../initialAdminPassword to Administrator password