在nginx配置文件中加上域名访问,重定向到本机的8080端口。
server {
listen 80;
server_name tomcat.qinyj.top;
root /application/tomcat8.0/webapps;
#index index.php index.html index.htm;
location / {
proxy_pass http://jenkins.qinyj.top:8080/jenkins;
}
charset utf-8;
但是访问之后忘记密码了,
在jenkins的安装目录下,找到config.xml配置文件,删除以下节点:

<useSecurity>true</useSecurity>
<authorizationStategy class="hudson.sucrity.FullControlOnceLoggedInAuthorizationStrategy">
...
</authorizationStategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>false</disableSignup>
...
</securityRealm>
重启tomcat服务即可。