Setting or clearing request->args

leki75 nginx-forum at nginx.us
Tue Sep 22 18:11:43 MSD 2009


Dear Igor,

I think you misunderstand me. Not the log output is the problem if I want to use eg. proxy_cache than I need to remove the query parameters before caching the content. 

The request flow should be (so the origin server wont get any query parameters):
GET /uri?params HTTP/1.x -> nginx -> GET /uri HTTP/1.x -> origin server

More on this, is it possible to modify the request flow programmatically without internal_redirect? Like:
GET /uri?param1=value1&param2=value2 HTTP/1.x -> nginx -> GET /uri?my_param=value3 HTTP/1.x -> origin server

My temporary workaround:
    location / {
        root /emptydir
        leki_test  on;
        error_page  404 = /FETCH$uri;
    }
    location /FETCH/ {
        internal;
        proxy_pass http://test/;
        proxy_cache            test;
        proxy_cache_min_uses   1;
        proxy_cache_valid      1d;
        proxy_cache_methods    GET HEAD;
        proxy_cache_use_stale  error timeout;
    }

But a better solution would be like this, which does not work at the moment:
    location / {
        leki_test  on;
        proxy_pass http://test;
        proxy_cache            test;
        proxy_cache_min_uses   1;
        proxy_cache_valid      1d;
        proxy_cache_methods    GET HEAD;
        proxy_cache_use_stale  error timeout;
    }

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






More information about the nginx mailing list