1 Star 1 Fork 3

K8sCat/resty-now

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jenkins.conf 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
wanhuasong 提交于 2020-09-14 08:51 . Add jenkins example
upstream jenkins {
server 127.0.0.1:8080;
}
server {
listen 443 ssl http2;
server_name example.com;
resolver 8.8.8.8;
client_max_body_size 300m;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
lua_ssl_verify_depth 2;
lua_ssl_trusted_certificate /etc/pki/tls/certs/ca-bundle.crt;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
}
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log logs/example.com_access_$year$month$day.log main;
error_log logs/example.com_error.log;
set $now_corp_id "";
set $now_agent_id "";
set $now_secret "";
set $now_callback_schema "https";
set $now_callback_host "example.com";
set $now_callback_uri "/oauth_wechat";
set $now_logout_uri "/logout";
set $now_token_expires "7200";
set $use_secure_cookie "true";
access_by_lua_file "/usr/local/openresty/nginx/conf/now.lua";
location / {
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
proxy_pass http://jenkins;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_max_temp_file_size 0;
#this is the maximum upload size
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffering off;
proxy_request_buffering off; # Required for HTTP CLI commands in Jenkins > 2.54
proxy_set_header Connection ""; # Clear for keepalive
}
location ~ "^/static/[0-9a-fA-F]{8}\/(.*)$" {
#rewrite all static files into requests to the root
#E.g /static/12345678/css/something.css will become /css/something.css
rewrite "^/static/[0-9a-fA-F]{8}\/(.*)" /$1 last;
}
location /userContent {
#have nginx handle all the static requests to the userContent folder files
#note : This is the $JENKINS_HOME dir
root /var/lib/jenkins/;
if (!-f $request_filename){
#this file does not exist, might be a directory or a /**view** url
rewrite (.*) /$1 last;
break;
}
sendfile on;
}
}
server {
listen 80;
server_name example.com;
location / {
rewrite ^/(.*) https://$server_name/$1 redirect;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/k8scat/resty-now.git
git@gitee.com:k8scat/resty-now.git
k8scat
resty-now
resty-now
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385