I’m setting up a new server (my first!).
I’ve installed Passenger and used passenger-install-nginx-module to install nginx. I’ve subsequently set it up and it all works.
However my app is Rails 3.1 and therefore uses the asset pipeline, and I didn’t realize I needed to have the PCRE library
nginx: [emerg] using regex "^/(assets)/" requires PCRE library in /opt/nginx/conf/nginx.conf:89
It needs it so that the following in nginx.conf works properly:
location ~ ^/(assets)/ {
root /path/to/public;
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
}
I installed PCRE by
sudo apt-get install libpcre3 libpcre3-dev
Now that I’ve added this I believe it is necessary to recompile nginx.
I’ve seen a few blog posts/ the nginx help about how to recompile it, but I really am a n00b. Can someone point me at step by step instructions?
Thanks!
The given answers will not work, because you are trying to use Nginx with Passenger, and Nginx needs the Passenger module also compiled.
Simply running
passenger-install-nginx-moduleagain will recompile nginx for you. If it doesn’t, you can tryrm -ron /opt/nginx (which is the default location nginx is installed into by Passenger). Be sure to backup your /opt/nginx/conf/nginx.conf if you value it.If you are using passenger standalone, and you need to recompile that, remove ~/.passenger/YOUR-MOST-RECENT-INSTALL and simply run passenger start again.