Unfortunately, Nginx needs to be compiled from source to add modules. I would suggest creating a Bash script that does all the work. When that works locally, add it to Travis add see what happens. Having a separate script is useful for pointing to from the docs as well.