Nginx做负载均衡的https文件
# test server
upstream test_server {
server 192.168.100.131:8080;
}
# HTTP server
server {
listen 80;
server_name test.aaliyun.cn;
# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
# HTTPS server
server {
listen 443 ssl;
server_name test.aaliyun.cn;
# SSL certificate configuration
ssl_certificate /data/businessServer/ssl/aaliyun.cn.pem;
ssl_certificate_key /data/businessServer/ssl/aaliyun.cn.key;
# Enable SSL/TLS protocols and ciphers
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
# Proxy settings
location / {
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
proxy_pass http://test_server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 150m;
}
}