OK, I have found some answers.
On a fresh Ubuntu install, despite the fact that 'which' shows a existent install of OpenSSL, you will still need some extra libs. You will also need some extra libs for PCRE which Nginx requires. So, before configuring, install the following:
sudo aptitude install libpcre3-dev
and also:
sudo aptitude install libssl-dev
After installing these, my ./configure command went like this:
./configure \
--prefix=/usr \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=nginx \
--group=nginx \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--with-http_ssl_module \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi
Also, because I have specified '--user=nginx' and '--group=nginx', we will need to run:
adduser --system --no-create-home --disabled-login --disabled-password --group nginx
The above will add the nginx user to the system.
Finally, I added the following config to /etc/nginx/nginx.conf:
user nginx;
worker_processes 6;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 10 10;
gzip on;
gzip_comp_level 1;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
listen *:80;
location / {
root /var/www;
index index.php;
# if file exists return it right away
if (-f $request_filename) {
break;
}
# otherwise rewrite the fucker
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php$1 last;
break;
}
}
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ ^/index.php
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
}
Please note that the above is just a quick, hacky config to ensure that everything is working. You will probably want to improve this to allow you to split up your config for vhosts, etc. See this for more: http://wiki.nginx.org/Configuration. Also, I have not gone through the installation of PHP-FPM (see below for more).
That's it.
References:
http://vladgh.com/blog/install-nginx-php-fpm-ubuntu-1004
http://recursive-design.com/blog/2010/03/16/compiling-nginx-with-flv-streaming-support-on-ubuntu/
http://interfacelab.com/nginx-php-fpm-apc-awesome/