wandenberg

nginx.conf

Dec 5th, 2011
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. events {
  2. worker_connections 1024;
  3. }
  4.  
  5. http {
  6. default_type application/octet-stream;
  7.  
  8. log_format response '***$time_local "$request" ($status) [$upstream_cache_status] $upstream_response_time ms ';
  9.  
  10. access_log logs/nginx-http_access.log response;
  11. error_log logs/nginx-http_error.log debug;
  12.  
  13. proxy_cache_path /tmp/nginx levels=1:2:1 keys_zone=test_zone:100m inactive=10d max_size=200m;
  14. proxy_temp_path /tmp/nginxproxy_temp 1 1;
  15.  
  16. server {
  17. listen 8090;
  18. server_name localhost;
  19.  
  20. location ~ /purge(/.*)\.(html|jpg|org|png|css|ico|txt)$ {
  21. proxy_cache_purge test_zone $1.$2 $2;
  22. group_clean_cache_purge $http_x_group_clean;
  23. break;
  24. }
  25.  
  26. location ~ \.(html|jpg|org|png|css|ico|txt)$ {
  27. proxy_pass http://localhost:8080;
  28. proxy_cache test_zone;
  29. proxy_cache_key $uri $1;
  30. proxy_cache_valid 200 1m;
  31. proxy_cache_valid 404 400 10m;
  32. proxy_cache_use_stale timeout updating;
  33. add_header X-Cache-Status $upstream_cache_status;
  34. }
  35. }
  36.  
  37. server {
  38. listen 8080;
  39. server_name localhost;
  40.  
  41. location / {
  42. root html/static;
  43. }
  44. }
  45. }
RAW Paste Data