我有一个温斯顿服务器(詹金斯)监听8443。Jenkins有一个有效的证书,Jenkins正在成功地完成证书终止:
JENKINS_ARGS="--httpPort=-1 --httpsKeyStore=/secure/jenkins.keystore --httpsKeyStorePassword=MY_PASSWORD --httpsPort=8443"唯一的问题是用户现在必须离开:https://example.com:8443
我不想要URL中的端口号。我要:
https://example.com:8443 -> https://example.com
https://example.com -> https://example.com
http://example.com -> https://example.com因此,我想我将在运行Jenkins的同一个实例上运行nginx。
所以我的问题是:
对那些类似的问题很抱歉。
我很确定AWS ELB不能代替nginx在这里做的事情,但我想我会把它扔出去,以防ELB也能帮我解决这个问题。
发布于 2017-11-17 14:23:47
1)不,您可以让Nginx使用流模块直接连接到Jenkins。
请注意,这是在1.9.0中添加的,但不是默认构建的一部分,因此您可能不得不自己构建。
它的工作原理非常类似于http server块,但是您必须在http块之外设置它。
stream {
upstream jenkins_server {
server jenkins:443;
}
server {
listen 443;
proxy_pass jenkins_server;
}
}2)您不需要nginx上的证书,但是您应该有一个端口80的http服务器块,它可以对第1部分中讨论的443流执行301。
server {
listen 80;
server_name your_server_name_here;
return 301 https://$host$request_uri;
}3)不,您不能使用nginx流将ssl从客户端传递到Jenkins服务器。
https://stackoverflow.com/questions/47339990
复制相似问题