daemon on;

user www-data www-data;
worker_processes auto;
worker_rlimit_nofile 32768;
error_log /var/log/nginx/error.log;

events
{
    use epoll;
}

http
{
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

    include /etc/nginx/mime.types;

    proxy_cache_path /var/cache/nginx/data levels=1:2 keys_zone=cache1:536870912 max_size=10737418240 inactive=999999m loader_sleep=0 loader_files=10000;
    proxy_cache cache1;
    proxy_cache_valid any 10m;
    proxy_cache_key 1111:0:$uri;
    proxy_temp_path /var/cache/nginx/tmp;
    proxy_set_header Host $resource_origin;

    # SSL
    ssl_session_cache   shared:SSL:40m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
    ssl_prefer_server_ciphers on;
    ssl_certificate     /opt/nginx_ssl/0000000001_35.pem;
    ssl_certificate_key /opt/nginx_ssl/0000000001_35.key;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    server {
        listen       80;
        listen       443 ssl http2;
        server_name  SERVERNAME;
        set $upstream "UPSTREAM_IP";
        set $resource_origin "UPSTREAM_HOST_HEADER";
        location / {
            proxy_pass http://$upstream;
        }
    }
}
