Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Nginx 1.26, link against system libraries, strip nginx binary #122

Merged
merged 6 commits into from
May 25, 2024

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    0c42a00 View commit details
    Browse the repository at this point in the history
  2. Link against system PCRE

    Absolutely no need to compile this ourselves.
    
    Because we have always built a custom libpcre3 (v8.x) and not the more modern PCRE2 (v10.x), we are enforcing usage of the old version for now.
    
    This is to ensure that existing configs with regexes continue to work, as PCRE2 is more aggressive in its pattern validation.
    
    To give a simple example, `/[\w-.]+/` now throws "Compilation failed: invalid range in character class at offset 3", and the `-` needs to be escaped, or moved to the end of the character class.
    dzuelke committed May 17, 2024
    Configuration menu
    Copy the full SHA
    c86b17f View commit details
    Browse the repository at this point in the history
  3. Link against system zlib

    dzuelke committed May 17, 2024
    Configuration menu
    Copy the full SHA
    a113cf9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3337f08 View commit details
    Browse the repository at this point in the history
  5. Strip nginx binary

    We only need debug symbols in the nginx-debug variant.
    
    Together with the slight improvement from the now system-linked PCRE and zlib, this helps a lot with overall size.
    
    Before:
    
        % ls -la nginx-heroku-2*.tgz
        -rw-r--r--  1 dzuelke  staff  5638356 May 17 13:50 nginx-heroku-20.tgz
        -rw-r--r--  1 dzuelke  staff  4559004 May 17 13:50 nginx-heroku-22.tgz
        % tar tzvf nginx-heroku-20.tgz
        -rw-r--r--  0 root   root     5349 Feb 21 01:58 ./mime.types
        -rwxr-xr-x  0 root   root  6705408 Feb 21 01:58 ./nginx
        -rwxr-xr-x  0 root   root  6870296 Feb 21 01:58 ./nginx-debug
        % tar tzvf nginx-heroku-22.tgz
        -rw-r--r--  0 root   root     5349 Feb 21 02:00 ./mime.types
        -rwxr-xr-x  0 root   root  4937400 Feb 21 02:00 ./nginx
        -rwxr-xr-x  0 root   root  5094584 Feb 21 02:00 ./nginx-debug
    
    After:
    
        % ls -la nginx-heroku-2*.tgz
        -rw-r--r--  1 dzuelke  staff  3181649 May 17 13:51 nginx-heroku-20.tgz
        -rw-r--r--  1 dzuelke  staff  2638964 May 17 13:51 nginx-heroku-22.tgz
        % tar tzvf nginx-heroku-20.tgz
        -rw-r--r--  0 root   root     5349 May 17 13:30 ./mime.types
        -rwxr-xr-x  0 root   root   973624 May 17 13:30 ./nginx
        -rwxr-xr-x  0 root   root  6746392 May 17 13:30 ./nginx-debug
        % tar tzvf nginx-heroku-22.tgz
        -rw-r--r--  0 root   root     5349 May 17 13:30 ./mime.types
        -rwxr-xr-x  0 root   root   973592 May 17 13:30 ./nginx
        -rwxr-xr-x  0 root   root  4974032 May 17 13:30 ./nginx-debug
    dzuelke committed May 17, 2024
    Configuration menu
    Copy the full SHA
    9275e37 View commit details
    Browse the repository at this point in the history
  6. Update nginx to 1.26.0 (latest stable)

    Also update headers-more-nginx-module to the latest 0.37 and pin nginx-uuid4-module to specific commit SHA
    dzuelke committed May 17, 2024
    Configuration menu
    Copy the full SHA
    73e7027 View commit details
    Browse the repository at this point in the history