Welcome! Log In Create A New Profile


Cannot disable caching.

November 02, 2009 11:33PM
Hello, I've been banging my head on this for a day now.

Nginx as caching frontend and Apache as backend on

How it's supposed to be:
1) /i/ is not passed, but served from FS
2) /bsbs/ is passed with NO caching
3) /torrent/ is passed with NO caching
4) Everything else is passed WITH caching

What happens:
1) /i/ is passed to Apache, but cached;
2) /bsbs/ is cached;
3) /torrent/ is NOT cached;
4) Everything else is cached.
5) Also requests to xxxx.com/bsbs (no end slash) get forwarded to xxxx.com:8181/bsbs

What am I doing wrong? Tanks in advance.

Server config:

proxy_cache_path /u02/nginx-cache-one levels=1:2 keys_zone=one:128m;
proxy_temp_path /u02/nginx-temp;

upstream realserver {

server {
listen 80;
server_name XXXX.com *.XXXX.com "";

open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;

location ^~ /i/ {
root /u01/web/XXXX.com/www-root/i;
access_log off;
expires 1d;

location ^~ /get/ {
proxy_pass http://realserver;
proxy_cache one;
proxy_cache_valid 30s;

location ^~ /torrent/ {
proxy_pass http://realserver;
proxy_cache off;

location ^~ /bsbs/ {
proxy_pass http://realserver;
proxy_cache off;

location / {
proxy_cache one;
proxy_cache_valid 2m;
proxy_pass http://realserver;

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /u01/nginx/html;

location ~ /\.ht {
deny all;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;

proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

Subject Author Posted

Cannot disable caching.

grmbl November 02, 2009 11:33PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready