1.nginx.conf

worker_processes  auto;
error_log /usr/local/var/log/nginx/error.log;
events {
worker_connections ;
}
http {
include mime.types;
default_type application/octet-stream;
#default_type text/html; client_max_body_size 2G;
server_names_hash_bucket_size ;
sendfile on;
keepalive_timeout ;
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 ;
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 ;
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;
}
}
05-11 15:14