I have a LEMP set-up in CentOS 7. I am planning to install the ngx_pagespeed module to it. When I was reading through the docs I came to realise that unlike Apache, I cannot install this module dynamically with Nginx. So from my understanding, I now need to uninstall the current Nginx, compile Nginx with ngx_pagespeed and re-install this compiled version. This comes to my next question: What happens if I have to upgrade Nginx or ngx_pagespeed module in the future and I already have a working production LEMP server with ngx_pagespeed? Do I then need to do the same i.e uninstall Nginx + ngx_pagespeed first, compile the latest version of the module & nginx and reinstall the newer version? It seems to be a big hassle. Isint there a better or simpler way to do this?
Yes you will have to rebuild nginx with pagespeed but once you got your RPM spec it's not that long. You can find one here.
You can upgrade between two nginx versions without any downtime with
USR2
andWINCH
signals so master processes using the new binary are spawn while you gracefully shutdown the old ones.