Ngnix cache everything except .cfm files?

bnlf
bnlf used Ask the Experts™
on
Hi,

   im using nginx on top of my iis7 for caching and proxy but i´m noticing long delays before a dynamic page is refreshed. is it a good idea to not cache dynamic pages? how can i do it?  im using coldfusion, pages ends with .cfm. I tried the following but it didnt seem to work.
thanks

 location ~ \.cfm$ {
                proxy_pass http://192.168.1.1;
        }

        location / {
                proxy_pass http://192.168.1.1;
                proxy_cache STATIC;
                proxy_cache_key         backend$request_uri;
                proxy_cache_valid       200  1h;
                proxy_cache_use_stale   error timeout invalid_header;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
system administrator
Top Expert 2007
Commented:
URI for dynamic pages looks like *.cfm?param=value&...
So you should use something like:

location ~* \.cfm {
                proxy_pass http://192.168.1.1;
}

Open in new window

Author

Commented:
Nopius, thanks. That was a noobie mistake. Actually i changed the layout of the server configuration. I'm now caching just a few static elements like images, js, css and proxying all the rest. working good so far.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial