user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    #ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    
     server {
         server_name 192.168.62.132;
         listen 443;
     ssl on;
         ssl_certificate      /etc/nginx/ca/nginx.crt;   
         ssl_certificate_key  /etc/nginx/ca/key.pem;    
         ssl_client_certificate /etc/nginx/ca/ca.pem;
         ssl_crl /etc/nginx/ca/ManagementCA.crl;
         ssl_session_timeout 5m;  
  
         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;  
         ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;  
         ssl_prefer_server_ciphers on;   
         
     ssl_stapling on;
         ssl_stapling_responder http://192.168.62.132:8080/ejbca/publicweb/status/ocsp;
         ssl_stapling_verify on;
         ssl_trusted_certificate /etc/nginx/ca/full.pem;
         ssl_verify_depth 2;
         ssl_verify_client on;           
         location / {
            set $fixed_destination $http_destination;  
            if ( $http_destination ~* ^https(.*)$ )  
            {  
             set $fixed_destination http$1;  
            }         
            proxy_set_header        Host $host;  
            proxy_set_header        X-Real-IP $remote_addr;  
            proxy_set_header        Destination $fixed_destination;
            proxy_set_header        ssl_client_cert $ssl_client_cert;
            #proxy_set_header        ssl_client_fingerprint $ssl_client_fingerprint;
            #proxy_set_header        ssl_client_raw_cert    $ssl_client_raw_cert;
            proxy_set_header        ssl_client_serial      $ssl_client_serial;
            proxy_set_header        ssl_client_s_dn        $ssl_client_s_dn;
            proxy_set_header        ssl_client_i_dn        $ssl_client_i_dn;
            proxy_set_header        ssl_client_verify      $ssl_client_verify; 
  
            proxy_pass http://192.168.62.132:18080;
         }
        }
    
}


#mail {
#    # See sample authentication script at:
#    # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#    # auth_http localhost/auth.php;
#    # pop3_capabilities "TOP" "USER";
#    # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#    server {
#        listen     localhost:110;
#        protocol   pop3;
#        proxy      on;
#    }
# 
#    server {
#        listen     localhost:143;
#        protocol   imap;
#        proxy      on;
#    }
#}

 

posted on 2016-06-05 13:38  梦中彩虹  阅读(1172)  评论(0编辑  收藏  举报