[root@localhost ssl]#cat /etc/nginx/conf.d/ssl.conf
#
# HTTPS server configuration
#
proxy_connect_timeout 60;
proxy_send_timeout 120;
proxy_read_timeout 360;
proxy_buffer_size 256k;
proxy_buffers 128 32k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 256k;
proxy_max_temp_file_size 128m;
proxy_redirect off;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_temp_path /dev/shm/proxy_temp;
proxy_cache_path /dev/shm/proxy_cache levels=1:2 keys_zone=cache_one:300m inactive=1d max_size=1g;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;gzip_vary on;
upstream www_server {
serverxxx.xxx.xxx.xxx:8080 max_fails=3 fail_timeout=30s;
}
server {
listen 443 ssl;
server_name*.123456.com 123456.com;
ssl_certificate ssl/123456.com.crt;
ssl_certificate_key ssl/123456.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://www_server;
}
location ~ .*\.(jpg|jpeg|gif|png|swf|css|js|txt|htc|ico)?$ {
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
add_header Cache "$upstream_cache_status";
proxy_cache_valid 200 304 30m;
proxy_cache_valid 404 500 502 503 504 3s;
proxy_cache_valid any 1h;
expires 2h;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://www_server;
}
}