Good Nginx reverse proxy tutorial

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by jasmineah on May 23, 2012 at 8:52pm

i am currently trying to install nginx as a reverse proxy on an apache2 debian squeeze server. I tried using nginx on its own but kept facing problems so i decided to use apache as am more familiar with it. Is there a good recent tutorial i can follow? the pressflow7 site will have a lot of images. Thanks in advance.

Comments

I've just found a tutorial

Posted by jasmineah on May 23, 2012 at 9:29pm

I've just found a tutorial here - http://hartlessbydesign.com/blog/view/206-virtualmin-apache-and-nginx-re... but am not sure if this is the right way to do it for drupal. Yes i am using virtual min.

That config

Posted by perusio on May 24, 2012 at 7:10am

is a bit "old". Also note that they're not using Nginx the proxy to serve static files, but are using another upstream. No need to do that. The proxy can serve static files with no problem. Unless of course you really need/want a dedicated static file server.

You'll need it if you want to cache static files using the Nginx cache, for example.

You can take most of the Apache stuff in terms of mod_rpaf config.

The keepalive timeouts are too big and the gzip disable for MSIE6 is outdated. There's a better way to do it.

Thank you for the reply. Do

Posted by jasmineah on May 24, 2012 at 7:36am

Thank you for the reply. Do you happen to know where I can find a recent tutorial and nginx config files? Cheers.

I do

Posted by perusio on May 24, 2012 at 7:42am

but I'm biased ;)

Check the group header.

Note also

Posted by perusio on May 24, 2012 at 7:43am

I have 0 experience with virtualmin. Panels introduce another level of indirection, IMHO, they make managing your server less transparent.

Lol I noticed but I trust you

Posted by jasmineah on May 24, 2012 at 9:18am

Lol I noticed but I trust you would give the right advice given you have a lot of experience with nginx. So if I decided to follow the tutorial, which config files can I use from your github repo? I mean the config which will be beneficial for Drupal?

Well

Posted by perusio on May 24, 2012 at 9:43am

there's some remarks on the README for that:

Nginx as a Reverse Proxy: Proxying to Apache for PHP

There's an upstream_phpapache.conf.

Thanks, will have a look

Posted by jasmineah on May 24, 2012 at 10:47am

Thanks, will have a look

Nginx Upload Progress Module

Posted by jasmineah on May 30, 2012 at 11:02am

Hi Perusio, I ended up installing nginx as the main webserver and removed apache. I included all your config files, except those in sites-available as i've not hosted any sites yet. So far the only problem i've faced is installing the upload progress module. I have followed these steps -

$ wget http://nginx.org/download/nginx-1.2.0.tar.gz

downloaded and uploaded via sftp - https://github.com/masterzen/nginx-upload-progress-module/tarball/v0.9.0

$ cd nginx-1.2.0

$ ./configure --add-module=/usr/local/src/masterzen-nginx-upload-progress-module-a788dea

$ make

$ make install

I checked whether the module had been installed using $ nginx –V and there was no line about the module. Any idea how i can get this to work. the current config only works because i commented the upload progress line in nginx.conf.

Does the module

Posted by perusio on May 30, 2012 at 11:40am

goes by on the compilation process and configure phase.

Thanks for the speedy reply.

Posted by jasmineah on May 30, 2012 at 12:53pm

Thanks for the speedy reply. I have downloaded the modules (listed in your makefile) and placed them inside the nginx-1.2.0 folder, in a new folder I named modules. Now comes the part I need help with.

Should i replace the code in the file with the one in your makefile (ie my Debian rules file) then run -$ ./configure After I run aptitude remove nginx?

OR

Should i run aptitude remove nginx and the the following -

./configure --conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-debug \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_flv_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-ipv6 \
--with-file-aio \
--with-http_secure_link_module \
--with-http_mp4_module \
--with-http_image_filter_module \
--add-module=/modules/nginx-upstream-fair \
--add-module=/modules/nginx-upload-progress-module \
--add-module=/modules/lua-nginx-module \
--add-module=/modules/nginx-auth-request-module \
--add-module=/modules/nginx-sticky-module \

Sorted

Posted by jasmineah on May 30, 2012 at 2:07pm

All sorted now. I removed nginx completely and added the dotdeb repos. having done that i ran an update and installed nginx-extras (aptitude install nginx-extras) and it installed all the modules i wanted to install.

Hope this helps someone.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /