Puppet利用Nginx多端口实现负载均衡
作者:网络转载 发布时间:[ 2013/3/4 14:43:40 ] 推荐标签:
5、我们依据puppet需求来修改配置文件nginx.conf,内容如下所示:
user www;
worker_processes 8;
events {
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
#定义puppet客户端访问puppet-server端日志格式
log_format main '$remote_addr - $remote_user [$time_local] "$request" $request_length $request_time $time_local'
'$status $body_bytes_sent $bytes_sent $connection $msec "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for $upstream_response_time $upstream_addr $upstream_status ';
access_log /usr/local/nginx/logs/access.log main;
upstream puppetmaster {
server 127.0.0.1:8141;
server 127.0.0.1:8142;
server 127.0.0.1:8143;
server 127.0.0.1:8144;
server 127.0.0.1:8145;
}
server {
listen 8140;
root /etc/puppet;
ssl on;
ssl_session_timeout 5m;
#如下为puppetmaster服务器端证书地址
ssl_certificate /var/lib/puppet/ssl/certs/server.cn7788.com.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/server.cn7788.com.pem;
ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem;
ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem;
ssl_verify_client optional;
#File sections
location /production/file_content/files/ {
types { }
default_type application/x-raw;
#定义puppet推送路径别名
alias /etc/puppet/files/;
}
# Modules files sections
location ~ /production/file_content/modules/.+/ {
root /etc/puppet/modules;
types { }
default_type application/x-raw;
rewrite ^/production/file_content/modules/(.+)/(.+)$ /$1/files/$2 break;
}
location / {
##设置跳转到puppetmaster负载均衡
proxy_pass http://puppetmaster;
proxy_redirect off;
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-Client-Verify $ssl_client_verify;
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
proxy_buffer_size 10m;
proxy_buffers 1024 10m;
proxy_busy_buffers_size 10m;
proxy_temp_file_write_size 10m;
proxy_read_timeout 120;
}
}
}
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11