So long story short I decided last week I wanted to integrate building Nginx from source into Trellis so I could get the cache_purge module and a few other 3rd party modules without having to manually do it everytime. Then I also at the same time got the idea that I wanted to try out the ngx_pagespeed module because I was building it from source anyways so why not. Instead of being normal and just manually installing this rig I decided it would be fun to integrate the whole deal into Trellis and make it configurable.
Moral of the story is I’m really tired and a couple clients are probably minorly annoyed with me. But hey… at least now anyone that has ever thought it would be cool to have Pagespeed and nginx from source in Trellis can actually demo it out!
In all seriousness though it’s pretty raw and I’m sure a few things a did at 4am are certainly not play book best practices. Also if you guys see any wtf things just know I went from never really writing or releasing anything like this to going hard at something that was pretty time consuming.
Anyways the documentation I wrote will get you through it easily but it needs expanded and I included links to nginx and google pages so you can research and decide for yourselves which modules you want to build your setup with. I’ll definatly help anyone who wants a hand with it and welcome anyone who has better ideas for a few things I clearly rushed. I’ll be working on it too, but I really hope a few of you get a little use out of it.
I have provisioned at least 10 GCE instances from scratch and put 3 different sites up on a staging server and they all seem to be working with no problems so enjoy!
Haha you probably want the link now too huh, I almost forgot, that would have been classic after making you read my epic rant.
I have in a good amount of stuff by default and I have tried it with almost all of them. It really doesn’t take me more than a few minutes longer than a normal Trellis provision maybe 5-7 mins extra if you go crazy.
RiFi2k, did you delete your trellis fork with PageSpeed nginx build? I’m unable to find your build-ngnx.yml in the linked repo. I might not be looking in the correct place for it. Thanks in advance!
You know I took it down because it was super dated, and now I compile NGINX into the .deb files instead of the long build I was doing before.
If you are interested in this still I have a role that builds out NGINX from source with the ngx_cache_purge module, I can easily show you how to mod it for pagespeed.
I was actually just kicking around the idea of adding the pagespeed in 100% automated like I had it before.
You tell me, if you like to get your hands a little dirty (nothing hard, I can give full instructions) I can share with you what I have currently. Or if you want hands off, give me a week.
I had built it from source using your “dated” repo. However, when I went to update Trellis to Xenial…my build fails because I reference https://github.com/RiFi2k/server-configs-nginx.git in my nginx/tasks/main.yml like so:
I guess I don’t mind getting my hands “a little dirty”, I think I have everything else already configured. At least, it worked before. I’m thinking all I should need is the h5bp/server-configs-nginx. What are your thoughts?
My server configs for nginx were a mirror of h5bp only I added in the
pagespeed on;
In the HTTP block of the nginx.conf
I’m 90% sure of this.
If you have a copy of my dated repo is there any way for you to share it with me, I could help you better. I had an unfortunate accident, my HD went splat a time back, and I was in a frenzy trying to recover some stuff and in my not paying attention I deleted that pagespeed repo of Trellis because I for some reason thought it was my straight clone of Trellis repo. I was up for like 36 hours straight…
That is actually the REAL reason it does not exist anymore
Understand. Losing a hard drive sucks a big one. I feel your pain…been there.
I sent my failed drive to a recovery company and paid $400 or so to have it recovered. Thankfully, they were able to recover all of my files.
Anyways, I have the repo but I’ll need to go through and remove all my info. It’ll take me a minute but I’ll get it to you.
I recently went through this and now have a successful “nginx-build” role for Ubuntu 16.04(xenial) working.
All the regular configs stay in place, and all that has to change is a var in group_vars/all/main.yml to toggle the standard install like :
Nearly every plugin available continues on to the complete the overall configuration (nginx.conf etc), while mine focus’ on build ONLY, well the nginx.service and init also, but it leaves the current process in place to fill out the rest.
The build time is obviously long but it would also only run - when: flags.changed which shouldn’t be often if ever.
I currently have several modules working, pagespeed and geoip etc.
I’m not sure I see this as part of the core options as it may open up too many potential pitfalls, complaints of slowness etc. I could see this as a galaxy role in your requirements.yml, or what is referred to in trellis as a “User contributed Extensions”.
I would like to see 1 small change to trellis to allow this to turn off nignx by package, so I can turn on by source, the rest can remain untouched .