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

Nginx: Compile dynamic modules #866

Closed
wants to merge 1 commit into from

Conversation

tangrufus
Copy link
Member

@tangrufus tangrufus commented Aug 15, 2017

Note:

  • it doesn't compile or install Nginx
  • it assumes dynamic module sources are git repos
  • it recompiles if Nginx version or dynamic module repos changed
  • it skips when nginx_dynamic_modules is empty

Usage (see #867):

# group_vars/all/main.yml
nginx_dynamic_modules:
  ngx_brotli:
    repo: https://github.com/google/ngx_brotli.git
    objs:
      - ngx_http_brotli_filter_module.so
      - ngx_http_brotli_static_module.so

Related: #863

@tangrufus tangrufus mentioned this pull request Aug 15, 2017
@tangrufus tangrufus force-pushed the nginx-dynamic-modules branch from 4f52df0 to a86e6ef Compare August 15, 2017 21:46
@@ -15,3 +15,8 @@ nginx_cache_path: /var/cache/nginx
nginx_cache_key_storage_size: 10m
nginx_cache_size: 250m
nginx_cache_inactive: 1h

# Dynamic modules
nginx_deb_src: 'deb-src http://ppa.launchpad.net/nginx/development/ubuntu xenial main'
Copy link
Contributor

@partounian partounian Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PPA is already set to this at the top of this file. So I would just remove any of your work for adding adding a deb-src but the rest looks okay.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you don't get this error?

$ sudo apt-get source nginx
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't actually test these.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems $ add-apt-repository --enable-source {{ nginx_ppa }} is a better choice

@tangrufus tangrufus force-pushed the nginx-dynamic-modules branch 2 times, most recently from 784fce2 to c37ee13 Compare August 17, 2017 12:24
@tangrufus
Copy link
Member Author

Updated:

  • .so files should have 644 file permission

@tangrufus tangrufus force-pushed the nginx-dynamic-modules branch from c37ee13 to 8688b06 Compare August 17, 2017 12:32
@tangrufus
Copy link
Member Author

Will this be consider to be merged, or should I extract it to be a galaxy role?

Thanks!

@swalkinshaw
Copy link
Member

Still undecided on this one. But I'm on vacation so not really thinking about this 😉

@tangrufus
Copy link
Member Author

Closing this and continue on #867 because this seems won't be merged without ngx_brotli

@tangrufus tangrufus closed this Sep 19, 2017
@swalkinshaw
Copy link
Member

I was actually thinking more about this last night and I'm probably fine with it :)

I'll re-open and review it soon

@swalkinshaw swalkinshaw reopened this Sep 19, 2017
@tangrufus tangrufus force-pushed the nginx-dynamic-modules branch from 8688b06 to 7a244d1 Compare September 21, 2017 06:23
@tangrufus
Copy link
Member Author

More changes to lure you into it:

@tangrufus
Copy link
Member Author

These commands works on my machine, not sure why it fails on travis:

$ ansible-playbook --syntax-check -e env=development deploy.yml
$ ansible-playbook --syntax-check -e env=development dev.yml
$ ansible-playbook --syntax-check -e env=development server.yml

@strarsis
Copy link
Contributor

@tangrufus: Can I use this for building the nginx pagespeed extension, too?

@tangrufus
Copy link
Member Author

tangrufus commented Jan 23, 2018

If you would like to build ngx_pagespeed as a dynamic module instead, use --add-dynamic-module= instead of --add-module=........
Pagespeed Doc

I had trouble setting ngx_pagespeed as a dynamic module last August. It was a ngx_pagespeed issue. But from the latest doc, it seems working now. You can give it a try.


This is untested and don't expect it will work without debugging:

# group_vars/all/main.yml
nginx_dynamic_modules:
  ngx_pagespeed:
    repo: https://github.com/apache/incubator-pagespeed-ngx.git
    version: some_commit_hash
    objs:
      - ngx_pagespeed.so

@runofthemill
Copy link
Contributor

this would be great to get merged - would allow Trellis to use https://github.com/masonicboom/ipscrub to reduce the surface area for GPDR issues

@strarsis
Copy link
Contributor

strarsis commented May 10, 2018

Could https://github.com/ANXS/nginx somehow be re-used for this?

@runofthemill
Copy link
Contributor

@strarsis that looks like it'd require a major refactor, since currently nginx is built & configured without an ansible-galaxy role, so highly unlikely, imo. did you try this PR with TangRufus' snippet to see if it works?

@swalkinshaw swalkinshaw closed this Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants