蒲公英v5p%n搭建局域网后用nginx做代理的配置 + nginx日志分片 切割
1.nginx.conf
worker_processes auto; error_log /usr/local/var/log/nginx/error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #default_type text/html; client_max_body_size 2G; server_names_hash_bucket_size 256; sendfile on; keepalive_timeout 65; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' '"$gzip_ratio" $request_time $bytes_sent $request_length'; underscores_in_headers on; include /usr/local/etc/nginx/conf.d/*.conf; }
2.代理的vhost的配置
1.1 代理zabbix server { listen 60001; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { index index.html index.htm; proxy_pass http://10.253.124.21:8111; proxy_connect_timeout 3000s; proxy_send_timeout 3000s; proxy_read_timeout 3000s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; client_max_body_size 100m; } }
1.2 代理jenkins--(url带后缀) server { listen 8888; server_name 172.19.134.43; #charset koi8-r; #access_log logs/host.access.log main; location /jenkins { index index.html index.htm; proxy_pass http://10.253.124.22:8888/jenkins; proxy_connect_timeout 3000s; proxy_send_timeout 3000s; proxy_read_timeout 3000s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; client_max_body_size 100m; } }
3. docker启动Jenkins blueocean 参考:https://blog.csdn.net/Field_Yang/article/details/107450300
docker run -u root -d -p 8080:8080 -p 50000:50000 -e JENKINS_OPTS="--prefix=/jenkins" -v jenkins-data:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkinsci/blueocean
nginx的配置
location /jenkins {
index index.html index.htm;
proxy_pass http://127.0.0.1:8080;
proxy_connect_timeout 3000s;
proxy_send_timeout 3000s;
proxy_read_timeout 3000s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
client_max_body_size 100m;
}
用一个例子来演示会更加清晰
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App