ryandotsmith / nginx-buildpack

Run NGINX in front of your app server on Heroku
456 stars 0 forks source link

Changing ./configure options in build_nginx.sh doesn't do anything when compiling on heroku server. #48

Open sollipse opened 9 years ago

sollipse commented 9 years ago

I'm trying to tweak this buildpack so that it usses the nginx ssl module.

I've added the right line to the build_nginx.ssh file, and I'm pointing my custom app at a fork of your buildpack with only that line changed.

However, I'm not seeing any ./configure changes reflected in my app. Running heroku run nginx -V shows that the exact same modules are running, even if I add or delete lines in build_nginx.sh

Is there an extra step to changing configure options beyond just changing this file?

jwgoh commented 9 years ago

Hello there! I hope you have already figured this out, if not let me explain. :smile: If you look at this line in bin/compile

cp "bin/nginx-$STACK" "$1/bin/nginx"

It actually copies the compiled nginx executable i.e nginx-cedar-14 in this repo into your dynos build directory. Hence why changing the configurations in build_nginx.sh doesn't do anything. I compiled Nginx myself (read more here and changed it in my forked repo. Hope this helps! :lollipop:

Sidenote

Initially I had thought that the ordering of my buildpacks was causing this issue. If you read this article, it says:

The last buildpack in the list will be used to determine the process types for the application. Any process types defined from earlier buildpacks will be ignored.

The buildpack (plans to?) compiles Nginx through a worker process specified in this Procfile. So if this buildpack comes before your other buildpacks, the shell script isn't executed and you will be copying this repo's nginx-cedar-14 file instead.

But looking at the above cp line, it seems as if what I said doesn't matter because it is coded to always copy the same file. I might be wrong on this.