# (no subject)

**URL:** <https://www.ruby-forum.com/t/no-subject/188292>\
**Category:** NGINX\
**Created:** [May 9, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/no-subject/188292 "2010-05-09T16:40:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elena\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@Elena\_Z](https://www.ruby-forum.com/u/Elena_Z)\
**Post date:** [May 9, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/no-subject/188292/1 "2010-05-09T16:40:56Z")

</div>

Hello Nginx - Mailinglist Members,

i try to optimize my nginx configuration. Currently i use  
memcache as frontend cache, but i would try to convert my  
current memcache-cache to a disc cache on ssd. My goal is  
setting and purging the cache from backend, is there a example  
on the net?

Thanks for your Help, kind regardas Elena

This is my current configuration:

```
location / {
  default_type text/html;
  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;
  proxy_intercept_errors on;

  if ($request_method = POST) {
      proxy_pass http://backend1;
      break;
  }

  if ($http_cookie ~* "NOCACHE=1" ) {
      proxy_pass http://backend1;
      break;
  }

  # fetch key from memcache: "yourproject:Action:$uri", like 

```

“yourproject:Action:/posts/1”  
set $memcached\_key “$host$uri”;  
memcached\_pass localhost:11211;

```
  error_page 404 502 = @fallback;
}

location @fallback {
  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;
  proxy_pass http://backend1;
  internal;
}

```

–  
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!  
Jetzt freischalten unter [Aktuelle Nachrichten aus Politik, Wirtschaft & Panorama | GMX](http://portal.gmx.net/de/go/maxdome01)
