Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx [nginx-announce] nginx-1.11.3

Discussion in 'Nginx and PHP-FPM news & discussions' started by eva2000, Jul 27, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Changes with nginx 1.11.3 26 Jul 2016

    *) Change: now the "accept_mutex" directive is turned off by default.

    *) Feature: now nginx uses EPOLLEXCLUSIVE on Linux.

    *) Feature: the ngx_stream_geo_module.

    *) Feature: the ngx_stream_geoip_module.

    *) Feature: the ngx_stream_split_clients_module.

    *) Feature: variables support in the "proxy_pass" and "proxy_ssl_name"
    directives in the stream module.


    *) Bugfix: socket leak when using HTTP/2.

    *) Bugfix: in configure tests.
    Thanks to Piotr Sikora.


    --
    Maxim Dounin
    http://nginx.org/

    _______________________________________________
    nginx-announce mailing list
    nginx-announce@nginx.org
    http://mailman.nginx.org/mailman/listinfo/nginx-announce

    Continue reading...
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    3 new nginx modules are included in nginx 1.11.3
    Of which 2 are enabled by default in nginx itself and the 3rd is ngx_stream_geoip_module which Centmin Mod 123.09beta01 only specifically enables by default via variable
    Code (Text):
    NGINX_STREAMGEOIP='y'
    

    Centmin Mod 123.08stable doesn't have support for NGINX_STREAMGEOIP variable so defaults to disabled.

    If you want to disable it set in your persistent config file /etc/centminmod/custom_config.inc
    Code (Text):
    NGINX_STREAMGEOIP='n'
    


    example below is nginx 1.11.3 on centmin mod 123.09beta01 with persistent config file /etc/centminmod/custom_config.inc set for
    Code (Text):
    NGINX_DYNAMICTLS='y'
    NGINX_LIBBROTLI=y
    ORESTY_LUANGINX='y'
    

    If you want to enable the new ngx_stream_geoip_module as a dynamic module in 123.09beta01 just set in persistent config file /etc/centminmod/custom_config.inc the extra variable
    Code (Text):
    NGXDYNAMIC_STREAMGEOIP='y'
    

    example with persistent config file /etc/centminmod/custom_config.inc
    Code (Text):
    NGXDYNAMIC_STREAMGEOIP='y'
    NGINX_DYNAMICTLS='y'
    NGINX_LIBBROTLI=y
    ORESTY_LUANGINX='y'
    

    dynamic nginx modules loaded
    Code (Text):
    ls -lah /usr/local/nginx/modules | grep -v .old
    total 2.9M
    drwxr-xr-x  2 root root 4.0K Jul 26 16:38 .
    drwxr-xr-x 10 root root 4.0K Jul 25 17:08 ..
    -rwxr-xr-x  1 root root  98K Jul 26 16:38 ngx_http_brotli_filter_module.so
    -rwxr-xr-x  1 root root 114K Jul 26 16:38 ngx_http_brotli_static_module.so
    -rwxr-xr-x  1 root root 141K Jul 26 16:38 ngx_http_fancyindex_module.so
    -rwxr-xr-x  1 root root 140K Jul 26 16:38 ngx_http_image_filter_module.so
    -rwxr-xr-x  1 root root 101K Jul 26 16:38 ngx_stream_geoip_module.so
    -rwxr-xr-x  1 root root 881K Jul 26 16:38 ngx_stream_module.so
    

     
    Last edited: Jul 27, 2016
  3. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    seems only web host provider that I use that supports EPOLLEXCLUSIVE in nginx 1.11.3 will be Linode as they're the only web host who's VPS instances default to Linux kernel 4.5.x and higher

    on linode VPSes
    Code (Text):
    uname -r
    4.5.5-x86_64-linode69
    


    nginx: 6acaa638fa07
    epoll_ctl(2) - Linux manual page
    Test on my Linode server suggests EPOLLEXCLUSIVE is not in linode's custom 4.5.5 kernel ?

    Code (Text):
    checking for EPOLLEXCLUSIVE ... not found
    

    full configure output excerpt
    Code (Text):
    ./configure --with-ld-opt="-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib" --with-cc-opt="-m64 -mtune=native -mfpmath=sse -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2" --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_stub_status_module --with-http_secure_link_module --with-openssl-opt="enable-tlsext" --add-module=../nginx-module-vts --with-libatomic --with-threads --with-stream=dynamic --with-stream_ssl_module --with-http_gzip_static_module --add-dynamic-module=../ngx_brotli --add-dynamic-module=../ngx_pagespeed-release-1.11.33.2-beta --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-stream_geoip_module=dynamic --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.0 --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_devel_kit-0.3.0 --add-module=../set-misc-nginx-module-0.30 --add-module=../echo-nginx-module-0.59 --add-module=../redis2-nginx-module-0.13 --add-module=../ngx_http_redis-0.3.7 --add-module=../memc-nginx-module-0.17 --add-module=../srcache-nginx-module-0.31 --add-module=../headers-more-nginx-module-0.30 --with-pcre=../pcre-8.39 --with-pcre-jit --with-http_ssl_module --with-http_v2_module --with-openssl=../libressl-2.3.6
    checking for OS
    + Linux 4.5.5-x86_64-linode69 x86_64
    checking for C compiler ... found
    + using GNU C compiler
    + gcc version: 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC)
    checking for gcc -pipe switch ... found
    checking for --with-ld-opt="-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib" ... found
    checking for -Wl,-E switch ... found
    checking for gcc builtin atomic operations ... found
    checking for C99 variadic macros ... found
    checking for gcc variadic macros ... found
    checking for gcc builtin 64 bit byteswap ... found
    checking for unistd.h ... found
    checking for inttypes.h ... found
    checking for limits.h ... found
    checking for sys/filio.h ... not found
    checking for sys/param.h ... found
    checking for sys/mount.h ... found
    checking for sys/statvfs.h ... found
    checking for crypt.h ... found
    checking for Linux specific features
    checking for epoll ... found
    checking for EPOLLRDHUP ... found
    checking for EPOLLEXCLUSIVE ... not found
    checking for O_PATH ... not found
    checking for sendfile() ... found
    checking for sendfile64() ... found
    checking for sys/prctl.h ... found
    checking for prctl(PR_SET_DUMPABLE) ... found
    checking for sched_setaffinity() ... found
    checking for crypt_r() ... found
    checking for sys/vfs.h ... found
    checking for nobody group ... found
    checking for poll() ... found
    checking for /dev/poll ... not found
    checking for kqueue ... not found
    checking for crypt() ... not found
    checking for crypt() in libcrypt ... found
    checking for F_READAHEAD ... not found
    checking for posix_fadvise() ... found
    checking for O_DIRECT ... found
    checking for F_NOCACHE ... not found
    checking for directio() ... not found
    checking for statfs() ... found
    checking for statvfs() ... found
    checking for dlopen() ... not found
    checking for dlopen() in libdl ... found
    checking for sched_yield() ... found
    checking for SO_SETFIB ... not found
    checking for SO_REUSEPORT ... found
    checking for SO_ACCEPTFILTER ... not found
    checking for SO_BINDANY ... not found
    checking for IP_BIND_ADDRESS_NO_PORT ... not found
    checking for IP_TRANSPARENT ... found
    checking for IP_BINDANY ... not found
    checking for IP_RECVDSTADDR ... not found
    checking for IP_PKTINFO ... found
    checking for IPV6_RECVPKTINFO ... found
    checking for TCP_DEFER_ACCEPT ... found
    checking for TCP_KEEPIDLE ... found
    checking for TCP_FASTOPEN ... found
    checking for TCP_INFO ... found
    checking for accept4() ... found
    checking for eventfd() ... found
    checking for int size ... 4 bytes
    checking for long size ... 8 bytes
    checking for long long size ... 8 bytes
    checking for void * size ... 8 bytes
    checking for uint32_t ... found
    checking for uint64_t ... found
    checking for sig_atomic_t ... found
    checking for sig_atomic_t size ... 4 bytes
    checking for socklen_t ... found
    checking for in_addr_t ... found
    checking for in_port_t ... found
    checking for rlim_t ... found
    checking for uintptr_t ... uintptr_t found
    checking for system byte ordering ... little endian
    checking for size_t size ... 8 bytes
    checking for off_t size ... 8 bytes
    checking for time_t size ... 8 bytes
    checking for setproctitle() ... not found
    checking for pread() ... found
    checking for pwrite() ... found
    checking for pwritev() ... found
    checking for sys_nerr ... found
    checking for localtime_r() ... found
    checking for posix_memalign() ... found
    checking for memalign() ... found
    checking for mmap(MAP_ANON|MAP_SHARED) ... found
    checking for mmap("/dev/zero", MAP_SHARED) ... found
    checking for System V shared memory ... found
    checking for POSIX semaphores ... not found
    checking for POSIX semaphores in libpthread ... found
    checking for struct msghdr.msg_control ... found
    checking for ioctl(FIONBIO) ... found
    checking for struct tm.tm_gmtoff ... found
    checking for struct dirent.d_namlen ... not found
    checking for struct dirent.d_type ... found
    checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
    checking for openat(), fstatat() ... found
    checking for getaddrinfo() ... found
    configuring additional modules
    adding module in ../nginx-module-vts
    + ngx_http_vhost_traffic_status_module was configured
    adding module in ../ngx_cache_purge-2.3
    + ngx_http_cache_purge_module was configured
    adding module in ../ngx_devel_kit-0.3.0
    + ngx_devel_kit was configured
    adding module in ../set-misc-nginx-module-0.30
    found ngx_devel_kit for ngx_set_misc; looks good.
    + ngx_http_set_misc_module was configured
    adding module in ../echo-nginx-module-0.59
    + ngx_http_echo_module was configured
    adding module in ../redis2-nginx-module-0.13
    + ngx_http_redis2_module was configured
    adding module in ../ngx_http_redis-0.3.7
    + ngx_http_redis_module was configured
    adding module in ../memc-nginx-module-0.17
    + ngx_http_memc_module was configured
    adding module in ../srcache-nginx-module-0.31
    + ngx_http_srcache_filter_module was configured
    adding module in ../headers-more-nginx-module-0.30
    + ngx_http_headers_more_filter_module was configured
    configuring additional dynamic modules
    adding module in ../ngx_brotli
    checking for Brotli C++ library (compressor.h) ... found
    + ngx_brotli was configured
    adding module in ../ngx_pagespeed-release-1.11.33.2-beta
    dirname: extra operand `gcc'
    Try `dirname --help' for more information.
    mod_pagespeed_dir=../ngx_pagespeed-release-1.11.33.2-beta/psol/include
    build_from_source=false
    checking for psol ... found
    List of modules (in reverse order of applicability):  ngx_http_write_filter_module ngx_http_header_filter_module ngx_http_chunked_filter_module ngx_http_v2_filter_module ngx_http_range_header_filter_module ngx_http_gzip_filter_module ngx_http_postpone_filter_module ngx_http_ssi_filter_module ngx_http_charset_filter_module ngx_http_sub_filter_module ngx_http_addition_filter_module ngx_http_userid_filter_module ngx_http_headers_filter_module
    checking for psol-compiler-compat ... found
    + ngx_pagespeed was configured
    adding module in ../ngx-fancyindex-0.4.0
    + ngx_http_fancyindex_module was configured
    checking for zlib library ... found
    checking for GD library ... found
    checking for GeoIP library ... found
    checking for atomic_ops library ... found
    creating objs/Makefile
    


    Code (Text):
    cat /usr/local/nginx/conf/dynamic-modules.conf 
    load_module "modules/ngx_http_brotli_filter_module.so";
    load_module "modules/ngx_http_brotli_static_module.so";
    load_module "modules/ngx_http_image_filter_module.so";
    load_module "modules/ngx_http_fancyindex_module.so";
    load_module "modules/ngx_pagespeed.so";
    load_module "modules/ngx_stream_module.so";
    load_module "modules/ngx_stream_geoip_module.so";
    load_module "modules/ngx_http_geoip_module.so";
    

    with persistent config set in /etc/centminmod/custom_config.inc
    Code (Text):
    NGINX_LIBBROTLI=y
    NGXDYNAMIC_STREAMGEOIP='y'
    NGXDYNAMIC_NGXPAGESPEED=y
    NGINX_PAGESPEED=y
    NGINX_DYNAMICTLS='y'
    
     
    Last edited: Jul 27, 2016
  4. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    4:44 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Upgraded, looking OK.

     
  5. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    looks good to me.

    FYI, in Module ngx_stream_geoip_module the example they use for Centmin Mod would actually look like this in nginx.conf as Centmin Mod Nginx already has a include file /usr/local/nginx/conf/geoip.conf for nginx geoip module which can be used for nginx stream geoip module too
    Code (Text):
    stream {
        include /usr/local/nginx/conf/geoip.conf;
    
        map $geoip_city_continent_code $nearest_server {
            default        example.com;
            EU          eu.example.com;
            NA          na.example.com;
            AS          as.example.com;
        }
    }

    in more of a context for nginx.conf and stream context placement
    Code (Text):
    worker_processes 2;
    worker_priority -10;
    
    worker_rlimit_nofile 260000;
    timer_resolution 100ms;
    
    pcre_jit on;
    include /usr/local/nginx/conf/dynamic-modules.conf;
    
    pid         logs/nginx.pid;
    
    events {
        worker_connections  2048;
        accept_mutex off;
        accept_mutex_delay 200ms;
        use epoll;
        #multi_accept on;
    }
    
    stream {
        include /usr/local/nginx/conf/geoip.conf;
    
        map $geoip_city_continent_code $nearest_server {
            default        example.com;
            EU          eu.example.com;
            NA          na.example.com;
            AS          as.example.com;
        }
    }
    
    http {
    

    Contents of /usr/local/nginx/conf/geoip.conf include file
    Code (Text):
    # SET the path to the .dat file used for determining the visitor's country from the IP-address ###
    geoip_country /usr/share/GeoIP/GeoIP.dat;
    
    # SET the path to the .dat file used for determining the visitor's country from the IP-address ###
    geoip_city /usr/share/GeoIP/GeoIPCity.dat;
    

    ngx_stream_geoip_module would then usually be used with TCP streams you setup via ngx_stream_module Module ngx_stream_core_module which is not enabled in official nginx by default but is enabled by default in Centmin Mod 123.09beta01's Nginx builds to allow you to setup load balancing within Nginx for TCP streams so you can load balance TCP setups for mysql, memcached, redis servers and much more !
     
    Last edited: Jul 27, 2016
  6. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:44 AM
    Mainline
    10.2
    To disable this 2 modules:
    --with-http_geoip_module
    --with-stream_geoip_module

    I will just declare:
    NGINX_STREAMGEOIP='n'
    NGINX_GEOIP='n'

    Right?
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes set them in persistent config /etc/centminmod/custom_config.inc and recompile nginx via centmin.sh menu option 4
     
  8. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    10:44 AM
    Mainline
    10.2
    Minimize Version :D
     
  9. eva2000

    eva2000 Administrator Staff Member

    53,223
    12,116
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,654
    Local Time:
    12:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah undoing all my great compiled nginx modules :) j/k - Centmin Mod's finer grain control over nginx modules at work :D