tengine-1.5.2 after configuration Session_sticky does not return session cookie problem resolution

Source: Internet
Author: User

The problem arose when a Tomcat node was added to the back-end cluster of the company Tengine (1.5.2 version) yesterday, and session_sticky instructions were added to the load Balancer cluster to enable client session retention. When the client accesses the reverse proxy, it does not return a session cookie, which causes the SessionID to be refreshed each time the connection is requested and cannot be logged on. On this issue many times, review Tengine official email list, try a variety of configurations, tossing the day did not find a solution, only in the official provision of 1.5.0 version changelog See the fix that has been done on this issue:

Tengine-1.5.0 [2013-07-31]
    • Bugfix: Fixed issue where session cookie was not issued by Session_sticky module in some cases [dinic]

      Http://tengine.taobao.org/changelog_cn.html#1_5_2

Finally simply download the latest 2.1.0 recompile installation, in the same configuration under the problem is resolved, the special post to avoid Yimeimei go the same detour.


The Tengine configuration is as follows:

worker_processes  1;events {    worker_connections  1024;}     dso {    load ngx_http_upstream_session_sticky_module.so ;} http {    include       mime.types;     default_type  application/octet-stream;    sendfile         on;    keepalive_timeout  65;     upstream tomcatcluster {        session_sticky  cookie=routerc domain=test.domain.net mode=insert fallback=on option=indirect;         server 10.1.12.53:9083 max_fails=10 fail_timeout=10s;         server 10.1.12.56:9083 max_fails=10 fail_ Timeout=10s;        check interval=500 rise=2 fall=5 timeout=3000 type=tcp;     }    server {         Listen       80;        server_name   localhost;        location / {            session_sticky_hide_cookie upstream=tomcatcluster;            proxy_pass http://tomcatcluster;         }        error_page    500 502 503 504  /50x.html;         location = /50x.html {             Root   html;        }    } 

The

Load module is as follows:

[[email protected] conf]# .. /sbin/nginx -mtengine version: tengine/1.5.2  (nginx/1.2.9) loaded modules:     ngx_core_module  (Static)     ngx_errlog_module  (static)      ngx_conf_module  (Static)     ngx_dso_module  (static)      ngx_syslog_module  (Static)     ngx_events_module  (static)      ngx_event_core_module  (Static)     ngx_epoll_module  (static)      ngx_procs_module  (Static)     ngx_proc_core_module  (Static)     ngx_openssl_module  (Static)     ngx_regex_module  (Static)     ngx_http_module  (Static)     ngx_http_core_module  (static )     ngx_http_log_module  (Static)     ngx_http_upstream_module  (Static)     ngx_http_static_module  (static)      ngx_http_gzip_static_module  (Static)     ngx_http_autoindex_module  (Static)     ngx_http_index_module  (Static)     ngx_http_concat_module   (Static)     ngx_http_auth_basic_module  (static)     ngx_http _access_module  (Static)     ngx_http_geo_module  (static)      ngx_http_map_module  (Static)     ngx_http_split_clients_module  (static)      ngx_http_referer_module  (Static)     ngx_http_rewrite_module  ( Static)     ngx_http_ssl_module  (static)     ngx_http_proxy_module   (Static)     ngx_http_fastcgi_module  (static)     ngx_http_ uwsgi_module  (Static)     ngx_http_scgi_module  (Static)     ngx_http_memcached_module   (Static)     ngx_http_empty_gif_module  (static)     ngx_http_ browser_module  (Static)     ngx_http_user_agent_module  (static)      ngx_http_upstream_ip_hash_module  (Static)     ngx_http_upstream_consistent_hash_ module  (Static)     ngx_http_upstream_check_module  (static)      ngx_http_upstream_least_conn_module  (Static)     ngx_http_upstream_keepalive_ module  (Static)     ngx_http_upstream_session_sticky_module  (shared, 3.1)     ngx_http_stub_status_module  (Static)     ngx_http_write_filter _module  (Static)     ngx_http_header_filter_module  (static)      ngx_http_chunked_filter_module  (Static)     ngx_http_range_header_filter_module  (static)      ngx_http_gzip_filter_module  (Static)     ngx_http_postpone_filter_module   (Static)     ngx_http_ssi_filter_module  (static)     ngx_http _charset_filter_module  (Static)     ngx_http_userid_filter_module  (static)      ngx_http_footer_filter_module  (Static)     ngx_http_trim_filter_ module  (Static)     ngx_http_headers_filter_module  (static)      ngx_http_copy_filter_module  (Static)     ngx_http_range_body_filter_module  (static)     ngx_http_not_modified_filter_module  (Static)


Under the 1.5.2 version:

[Email protected] conf]# curl-i http://127.0.0.1HTTP/1.1 okserver:tengine/1.5.2date:thu, Jul 01:32:49 GMTC Ontent-type:text/html;charset=utf-8content-length:6957connection:keep-aliveset-cookie:jsessionid= d633a39f35aa4a8be1429bd12c2cdc8d; path=/; Httponlyset-cookie: _site=1; Path=/content-language:en-us

The curl result does not return a session cookie (the cookie name configured here is called ROUTERC)


Under the 2.1.0 version:

[Email protected] conf]# curl-i http://127.0.0.1HTTP/1.1 okserver:tengine/2.1.0date:thu, Jul 02:42:39 GMTC Ontent-type:text/html;charset=utf-8content-length:6957connection:keep-aliveset-cookie:jsessionid= 9d04a1390ff849dc44643bfaac1de206; path=/; Httponlyset-cookie: _site=1; Path=/content-language:en-usset-cookie:routerc=d635956645d98c4834fa077076767949;domain=test.domain.net; path=/

normal return "set-cookie:routerc=d635956645d98c4834fa077076767949;domain=test.bingodu.net; path=/"

tengine-1.5.2 after configuration Session_sticky does not return session cookie problem resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.