Nginx proxy-caching Apache autoindex

christogouws nginx-forum at nginx.us
Tue Dec 8 09:34:48 MSK 2009


I run 1 server, with 3 virtualhosts,
the other 2 vhosts work fine, its just the one with the apache autoindex.


### NGINX config ###
user  www;
worker_processes  1; # increase value for multiple CPU's - 2 CPU's = 2 worker_processes
events {
   worker_connections  1024; # maximum concurrent connections to server
}
http {
   include       mime.types;
   default_type  application/octet-stream;
   server_names_hash_bucket_size 64;
include vhosts/*.conf; # include all configuration files in /usr/local/etc/nginx/vhosts/
}

----------------------------------------------------------------------------------------

### Virtual host config ###

## START upstream

upstream my-stream {
       server my.server.com;
} 
## END upstream

server {
       listen  80;
       server_name lb.my.server.com;
       location /
         {
               proxy_pass http://my-stream; # Use upstream for proxy & load balance
               root /usr/local/www/lb.my.server.com/cache; # Caching directory for this virtual host on nginx
               autoindex  on;
         }##end location

proxy_store             on;
proxy_store_access      user:rw          group:rw  all:r; # set cache access permissions
proxy_set_header        Host    $host;  # Forward IP headers to Apache
proxy_set_header        X-Real-IP       $remote_addr; # Forward IP headers to Apache
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; # Forward IP headers to Apache
}       ##end server

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,28496,28776#msg-28776




More information about the nginx mailing list