Want more timely Centmin Mod News Updates?
Become a Member

Nginx Nginx LUA - 1.9.15?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Oxide, May 2, 2016.

  1. Oxide

    Oxide Active Member

    503
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:41 PM
    Is it supported?

    What version should I specify in custom_config ? :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,157
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    1:41 PM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: May 3, 2016
  3. Oxide

    Oxide Active Member

    503
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:41 PM
    Interesting.

    I am currently running: "1.2.3-eva2000.08"

    Would it be "safe" for me to upgrade to 123.09beta01?

    I would only be interested in enabling nginx lua / redis.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,157
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    1:41 PM
    Nginx 1.13.x
    MariaDB 5.5
    all 110+ of my servers now run 123.09beta01 for several months but it's beta for a reason continued testing, feedback and bug fixes are expected

    forums here also run 123.09beta01 as does centminmod.com site's servers which actively use nginx lua module and lua coding in some form :)
     
    • Informative Informative x 1
  5. Oxide

    Oxide Active Member

    503
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:41 PM
    Thanks a lot, updating now to that branch. Love the way I can update via git easily, love it! :D
     
  6. Oxide

    Oxide Active Member

    503
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:41 PM
    Instead of making a new topic, i thought I would ask here.

    Can I use custom_config.inc to load a custom Nginx Module.. For example: GitHub - kyprizel/testcookie-nginx-module: simple robot mitigation module using cookie based challenge/response technique ?
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,157
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    1:41 PM
    Nginx 1.13.x
    MariaDB 5.5
    Unfortunately nope - not without some additional coding to variable-ize the module - examples below

    I posted an example of how to add nginx modules to Centmin Mod at centminmod.com/nginx_webdav.html for webdav prior to it becoming an official part of Centmin Mod's default module list. You can use that example to pretty much add or extend Nginx with additional modules.

    Only limitations are
    1. You need to know generally how to add Nginx modules and that is basically the same for any Nginx server not just Centmin Mod
    2. You also need to know the instructions for specific Nginx module
    3. You also need to know any prerequiste system dependencies and YUM packages that the Nginx module requires as I may not know what they are as I may have never used the Nginx module you want.
    4. I'm limited to what I can add to Centmin Mod by what I know and use usually and what I am comfortable with supporting. So that limits what officially I can add to Centmin Mod. But you are free to add whatever you need using above as a guide.
    For Centmin Mod Nginx, download tar.gz nginx modules to /svr-setup and extract and then editing inc/nginx_configure.inc just use the same --add-module=../nginx-module-name line.

    Posted a more recent example below. Actual Github commits for adding 3 new Centmin Mod Nginx modules, echo-nginx-module, set-misc-nginx-module and ngx_devel_kit are located below (you can use these changes and webdav example as a blue print for understanding how to extend and add your own Centmin Mod Nginx modules.

    Github commits for 3 new Nginx modules

    General Info on Adding New Nginx Modules



    There's 5 basic steps involve in adding a new Nginx module into Centmin Mod Nginx server for Centmin Mod .08 beta02 and higher. They involve editing 5 Centmin Mod files.
    1. centmin.sh - add VARIABLE name to define the nginx module's version number if there is one
    2. inc/downloadlinks.inc - add 2 VARIABLES to define the module download link and filename
    3. inc/downloads.inc - add download function to download the module using download link defined in inc/downloadlinks.inc and test the download validity i.e. untar it using filename defined in inc/downloadlinks.inc
    4. inc/nginx_configure.inc - add check variables to grab latest nginx module extracted directory and put it info directory variable to be called from Nginx ./configure options only if NGINX_OPENRESTY='y'
    5. inc/nginx_upgrade.inc - add to existing file check, the new module download file name (defined in inc/downloadlinks.inc). This ensures, when you run centmin.sh menu option 4 to upgrade Nginx, if the new nginx module download file doesn't exist in /svr-setup, it will download it and extract it before the Nginx compilation begins
    Another way of doing it is shown at Nginx - A straight forward tutorial to install test-cookie? | Centmin Mod Community This way doesn't allow for managing nginx module version updates and auto updates via centmin.sh menu option 4 like the above method.

    The above is for nginx modules requiring additional downloads to be configured. There's also nginx modules which do not need additional downloads but just enabling of the nginx module itself. I just added ngx_http_auth_request_module to Nginx for .08 beta 03 as it only required adding --with-http_auth_request_module to configure options. You can see the changes I did here add ngx_http_auth_request_module support · centminmod/centminmod@ec079c5 · GitHub - similar to above instructions just did not need to touch inc/downloadslinks.inc and inc/downloads.inc and inc/nginx_upgrade.inc as there are NO additional downloads to account for and check.