Klaus Demo nginx / 916ee8e
proxy_ssl_session_reuse Igor Sysoev 12 years ago
3 changed file(s) with 29 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
358358 NGX_HTTP_LOC_CONF_OFFSET,
359359 offsetof(ngx_http_proxy_loc_conf_t, upstream.hide_headers),
360360 NULL },
361
362 #if (NGX_HTTP_SSL)
363
364 { ngx_string("proxy_ssl_session_reuse"),
365 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
366 ngx_conf_set_flag_slot,
367 NGX_HTTP_LOC_CONF_OFFSET,
368 offsetof(ngx_http_proxy_loc_conf_t, upstream.ssl_session_reuse),
369 NULL },
370
371 #endif
361372
362373 ngx_null_command
363374 };
16441655 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
16451656
16461657 conf->upstream.intercept_errors = NGX_CONF_UNSET;
1658 #if (NGX_HTTP_SSL)
1659 conf->upstream.ssl_session_reuse = NGX_CONF_UNSET;
1660 #endif
16471661
16481662 /* "proxy_cyclic_temp_file" is disabled */
16491663 conf->upstream.cyclic_temp_file = 0;
18321846
18331847 ngx_conf_merge_value(conf->upstream.intercept_errors,
18341848 prev->upstream.intercept_errors, 0);
1849
1850 #if (NGX_HTTP_SSL)
1851 ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
1852 prev->upstream.ssl_session_reuse, 1);
1853 #endif
18351854
18361855 ngx_conf_merge_value(conf->redirect, prev->redirect, 1);
18371856
788788 c->sendfile = 0;
789789 u->output.sendfile = 0;
790790
791 if (u->peer.set_session(&u->peer, u->peer.data) != NGX_OK) {
792 ngx_http_upstream_finalize_request(r, u,
793 NGX_HTTP_INTERNAL_SERVER_ERROR);
794 return;
791 if (u->conf->ssl_session_reuse) {
792 if (u->peer.set_session(&u->peer, u->peer.data) != NGX_OK) {
793 ngx_http_upstream_finalize_request(r, u,
794 NGX_HTTP_INTERNAL_SERVER_ERROR);
795 return;
796 }
795797 }
796798
797799 r->connection->log->action = "SSL handshaking to upstream";
818820
819821 if (c->ssl->handshaked) {
820822
821 u->peer.save_session(&u->peer, u->peer.data);
823 if (u->conf->ssl_session_reuse) {
824 u->peer.save_session(&u->peer, u->peer.data);
825 }
822826
823827 c->write->handler = ngx_http_upstream_send_request_handler;
824828 c->read->handler = ngx_http_upstream_process_header;
147147
148148 #if (NGX_HTTP_SSL)
149149 ngx_ssl_t *ssl;
150 ngx_flag_t ssl_session_reuse;
150151 #endif
151152
152153 } ngx_http_upstream_conf_t;