user nginx; worker_processes auto; error_log /var/log/nginx/error.logwarn; pid /var/run/nginx.pid; events { worker_connections 1025; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''"$http_user_agent""$http_x_forwarded_for"'; access_log /var/log/nginx/access.logmain; sendfile on; keepalive_timeout 65; upstream backend_http { server 1.1.1.1:80weight=2; server 2.2.2.2:80weight=2; } upstream backend_https { server 1.1.1.1:443weight=2; server 2.2.2.2:443weight=2; } server { listen 80; server_name aaaa.com; location / { proxy_pass http://backend_http; proxy_set_header Host$host; proxy_set_header X-Real-IP$remote_addr; proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for; } } server { listen 443ssl; server_name eeee.com; ssl_certificate /etc/nginx/cert/eeee.com.https.cert; ssl_certificate_key /etc/nginx/key/eeee.com.https.key; location / { proxy_pass http://backend_http; proxy_set_header Host$host; proxy_set_header X-Real-IP$remote_addr; proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for; } } }