Hi there,
on the meeting yesterday i've heared from the proxy problems with apache + mod_proxy so i just wanne tell a bit from an other proxy which i set up a few weeks ago in firm. So talking about Nginx. In the firm i work we had problems with the many different URLs behind the old proxy and we come to an state were apache has been to slow. One of the main points why i looked for a different Software was the IP-Forward Problem we always had. So i found Nginx. Nginx is a very fast proxy http://wiki.nginx.org/Main and it comes with many modules to handle the connection. On the other hand it is very easy to use.
So, take a short look:
proxy_redirect off; proxy_set_header X-Real-IP $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffers 32 4k;
this does all the IP-Forwarding
and the (in this case webdav) is the configuration of the server
server { listen 80; server_name isg-dav1.XX.XXXXX.de; access_log /var/log/nginx/localhost.access.log; error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/nginx-default; } location / { proxy_pass http://isg-dav.XXXX.XXXXX.de; include /etc/nginx/proxy.conf; } }
So if any question, i try to answer them,
Greets
Joerg
On Fri, 10 Jul 2009, Jörg Stephan wrote:
Hi there,
on the meeting yesterday i've heared from the proxy problems with apache + mod_proxy so i just wanne tell a bit from an other proxy which i set up a few weeks ago in firm. So talking about Nginx. In the firm i work we had problems with the many different URLs behind the old proxy and we come to an state were apache has been to slow. One of the main points why i looked for a different Software was the IP-Forward Problem we always had. So i found Nginx. Nginx is a very fast proxy http://wiki.nginx.org/Main and it comes with many modules to handle the connection. On the other hand it is very easy to use.
So, take a short look:
proxy_redirect off; proxy_set_header X-Real-IP $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffers 32 4k;
this does all the IP-Forwarding
and the (in this case webdav) is the configuration of the server
server { listen 80; server_name isg-dav1.XX.XXXXX.de; access_log /var/log/nginx/localhost.access.log; error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/nginx-default; } location / { proxy_pass http://isg-dav.XXXX.XXXXX.de; include /etc/nginx/proxy.conf; } }
So if any question, i try to answer them,
Stuff like this comes up from time to time and the question I always have is: What is it we're wanting to do that we can't currently do with the setup we have now? We're a group with a lot of turnover and almost everyone knows how to use apache so why is it worth it to us to switch to nginx?
-Mike
Well, maybe there isnt any reason to change. You are right, everybody knows apache, and as long as apache works fine there is definitely no reason, but as we were running into proxy problems i thought it wo be the right time to show up an alternative to the apache proxy. If you take a look at the modules page http://wiki.nginx.org/NginxModulesyou just see all nginx can do. Apache is first of all an http server which can do reverse proxy. Nginx is first of all an proxy.
I just wanted to show an alternative, thats all.
Greetz Joerg
http://www.linuxjournal.com/article/10108
just to point to
2009/7/10 Jörg Stephan johe.stephan@googlemail.com
Well, maybe there isnt any reason to change. You are right, everybody knows apache, and as long as apache works fine there is definitely no reason, but as we were running into proxy problems i thought it wo be the right time to show up an alternative to the apache proxy. If you take a look at the modules page http://wiki.nginx.org/NginxModulesyou just see all nginx can do. Apache is first of all an http server which can do reverse proxy. Nginx is first of all an proxy.
I just wanted to show an alternative, thats all.
Greetz Joerg
On Fri, Jul 10, 2009 at 06:35:57AM -0500, Mike McGrath wrote:
Stuff like this comes up from time to time and the question I always have is: What is it we're wanting to do that we can't currently do with the setup we have now? We're a group with a lot of turnover and almost everyone knows how to use apache so why is it worth it to us to switch to nginx?
If we are wanting "to serve static files faster", then yes, Nginx would do that for us[0]. I use Nginx for all of my personal application deployments, and I've been extremely impressed with it's speed and ease of configuration. However, it's WSGI support is a bit questionable, so we would only want to use it as for serving static files & reverse proxying. You can also configure it to hit memcached before apache, which is pretty neat.
Mike is right though, if it's not solving an real problems for us, we're better off using what we are already familiar with until we see an obviously need for it.
luke
On Fri, 10 Jul 2009, Luke Macken wrote:
On Fri, Jul 10, 2009 at 06:35:57AM -0500, Mike McGrath wrote:
Stuff like this comes up from time to time and the question I always have is: What is it we're wanting to do that we can't currently do with the setup we have now? We're a group with a lot of turnover and almost everyone knows how to use apache so why is it worth it to us to switch to nginx?
If we are wanting "to serve static files faster", then yes, Nginx would do that for us[0]. I use Nginx for all of my personal application deployments, and I've been extremely impressed with it's speed and ease of configuration. However, it's WSGI support is a bit questionable, so we would only want to use it as for serving static files & reverse proxying. You can also configure it to hit memcached before apache, which is pretty neat.
That is interesting though, does it just store entire html pages in memcached?
-Mike
On Fri, Jul 10, 2009 at 08:56:07AM -0500, Mike McGrath wrote:
On Fri, 10 Jul 2009, Luke Macken wrote:
On Fri, Jul 10, 2009 at 06:35:57AM -0500, Mike McGrath wrote:
Stuff like this comes up from time to time and the question I always have is: What is it we're wanting to do that we can't currently do with the setup we have now? We're a group with a lot of turnover and almost everyone knows how to use apache so why is it worth it to us to switch to nginx?
If we are wanting "to serve static files faster", then yes, Nginx would do that for us[0]. I use Nginx for all of my personal application deployments, and I've been extremely impressed with it's speed and ease of configuration. However, it's WSGI support is a bit questionable, so we would only want to use it as for serving static files & reverse proxying. You can also configure it to hit memcached before apache, which is pretty neat.
That is interesting though, does it just store entire html pages in memcached?
As far as I know nginx doesn't store things in memcached itself, but in your web application you can do fancy things like cache fully rendered HTML pages in memcached, and you can tell nginx to look there first.
This article, "Pylons on Nginx with Memcached and SSI", is what inspired me to dive into this stuff a while back:
http://www.reshetseret.com/app/blog/?p=3
They use a simple decorator to do the caching. However, this won't work out of the box with TurboGears2 since there is a piece of ToscaWidgets middleware that injects the widget resources at the last minute -- so your cache would be missing a ton of JS and CSS files. However, I've been thinking about having Moksha inject a piece of middleware at the top of the stack to optionally throw the rendered output in memcached. Anyway... fun stuff :)
luke
infrastructure@lists.fedoraproject.org