# Questions about proxy\_cache and ssi

**URL:** <https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669>\
**Category:** NGINX\
**Created:** [September 24, 2013, 8:35am UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669 "2013-09-24T08:35:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 24, 2013, 8:35am UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669/1 "2013-09-24T08:35:43Z")

</div>

Hello list,

```
I hava a nginx config problem , Please help look !
I use proxy_cache and ssi.

```

_nginx config :_  
ssi on;  
ssi\_silent\_errors on;  
ssi\_types text/shtml;

proxy\_temp\_path /cache/proxy\_temp;  
proxy\_cache\_path /cache/proxy\_cache levels=1:2 keys\_zone=tmp\_cache:2000m  
inactive=10000d max\_size=200G;  
proxy\_next\_upstream error timeout invalid\_header http\_504 http\_500  
http\_502 http\_503;

_example:_  
\*  
\*  
[http://x.com/1.shtml:](http://x.com/1.shtml:)  
  
hello world1 !  
  
\<\html\>

```
    http://x.com/2.shtml:
    <html>
     hello world2 !
     <!--#include virtual="/include/foot.html"-->
    <\html>
     .......

     http://x.com/include/foot.html:
    <html>
     old, i am include info !
    <\html>

```

_problem:_  
\*  
\*  
Edit this file: [http://x.com/include/include/foot.html](http://x.com/include/include/foot.html)  
  
new, i am include info !  
\<\html\>

```
  I use ngx_cache_purge to clear the cache :

```

[http://x.com/include/include/foot.html](http://x.com/include/include/foot.html)

```
  But do not take effect cache these pages :

  open http://x.com/1.shtml
  the content is :
    <html>
     hello world1 !
     old, i am include info !
    <\html>

  open http://x.com/2.shtml
  the content is :
    <html>
     hello world2 !
     old, i am include info !
    <\html>

  I have to clear the cache in order to take effect :
  http://x.com/purge/1.shtml
  http://x.com/purge/2.shtml

  open http://x.com/1.shtml
  the content is :
    <html>
     hello world1 !
     new, i am include info !
    <\html>

  open http://x.com/2.shtml
  the content is :
    <html>
     hello world2 !
     new, i am include info !
    <\html>

```

If I have a lot shtml files ,Must be more clear the cache.  
[http://x.com/purge/1.shtml](http://x.com/purge/1.shtml)  
[http://x.com/purge/2.shtml](http://x.com/purge/2.shtml)  
[http://x.com/purge/3.shtml](http://x.com/purge/3.shtml)  
[http://x.com/purge/4.shtml](http://x.com/purge/4.shtml)  
[http://x.com/purge/5.shtml](http://x.com/purge/5.shtml)  
[http://x.com/purge/6.shtml](http://x.com/purge/6.shtml)  
…

I just need to clear a cache: [http://x.com/purge/include/foot.html](http://x.com/purge/include/foot.html) ,  
all  
SHTML pages to take effect.  
Is there a way to solve?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![FoxBin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c0e974/32.png) [@FoxBin](https://www.ruby-forum.com/u/FoxBin)\
**Post date:** [September 24, 2013, 8:43am UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669/2 "2013-09-24T08:43:54Z")

</div>

Hell FoxBin,

can you please post your whole proxy\_\* - config?

since your footer.html gets included and displayed via 1/2/3.html, this  
file  
itself will  
never get cached, thus never can be purged, because it becomes part of  
the  
output of 1/2/3.html.

“simple” caching is done based on URLs

regards,

mex

Posted at Nginx Forum:

> **[Re: \[Ask for help\] Questions about proxy\_cache and ssi](https://forum.nginx.org/read.php?2,243085,243086#msg-243086)**
>
> Hello list, I hava a nginx config problem , Please help look ! I use proxy\_cache and ssi. \*nginx config :\* ssi on; ssi\_silent\_errors on; ssi\_types text/shtml; proxy\_temp\_path /cache/proxy\_temp; proxy\_cache\_path /cache/pro

---

<div class="post-metadata">

**Author:** ![FoxBin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c0e974/32.png) [@FoxBin](https://www.ruby-forum.com/u/FoxBin)\
**Post date:** [September 25, 2013, 2:29pm UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669/3 "2013-09-25T14:29:16Z")

</div>

hi,mex :

this is my nginx config:

user nobody;  
worker\_rlimit\_nofile 65500;  
worker\_processes 8;  
error\_log logs/error.log;

events {  
use epoll;  
worker\_connections 65500;  
}

http {  
include mime.types;  
default\_type application/octet-stream;  
sendfile on;  
keepalive\_timeout 65;  
gzip off;  
client\_max\_body\_size 1g;  
proxy\_redirect off;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;

```
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
index index.shtml index.html index.htm;

access_log logs/access.log ;

proxy_temp_path /cache/proxy_temp;
proxy_cache_path /cache/proxy_cache levels=1:2 

```

keys\_zone=tmp\_cache:2000m  
inactive=10000d max\_size=200G;  
proxy\_next\_upstream error timeout invalid\_header http\_504 http\_500  
http\_502 http\_503;

```
upstream backend {
    server 192.168.1.100;
    server 192.168.1.101;
    server 192.168.1.102 backup;

```

}

```
server {
        server_name www.x.com ;

        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://backend;
            proxy_cache tmp_cache;
            proxy_cache_key $host$uri;
            proxy_cache_valid 1000d;
        }

        location ~ /purge(/.*) {
            allow 192.168.1.254;
            deny all;
            proxy_cache_purge tmp_cache $host$1$is_args$args;
        }

```

}

shtml files:  
[www.x.com/1.shtml](http://www.x.com/1.shtml)  
[www.x.com/2.shtml](http://www.x.com/2.shtml)  
[www.x.com/3.shtml](http://www.x.com/3.shtml)  
[www.x.com/4.shtml](http://www.x.com/4.shtml)  
[www.x.com/5.shtml](http://www.x.com/5.shtml)  
[www.x.com/6.shtml](http://www.x.com/6.shtml)  
…more

include files:  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html) old, i am include info  
!

Edit this file: [http://www.x.com/include/include/foot.html](http://www.x.com/include/include/foot.html) new,  
i  
am include info ! \<\html\>

I use ngx\_cache\_purge to clear the cache :  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html)

But do not take effect cache these pages :  
open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

old, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

old, i am include info ! \<\html\>

I have to clear the cache in order to take effect :  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)

open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

hello world1 ! new, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

hello world2 ! new, i am include info ! \<\html\>

If I have a lot shtml files ,Must be more clear the cache ☹  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)  
[http://www.x.com/purge/3.shtml](http://www.x.com/purge/3.shtml)  
[http://www.x.com/purge/4.shtml](http://www.x.com/purge/4.shtml)  
[http://www.x.com/purge/5.shtml](http://www.x.com/purge/5.shtml)  
[http://www.x.com/purge/6.shtml](http://www.x.com/purge/6.shtml)  
…more

I just need to clear a cache: [http://x.com/purge/include/foot.html](http://x.com/purge/include/foot.html) , all  
SHTML pages to take effect.

Is there a way to solve?

Thanks in advance 🙂

Posted at Nginx Forum:

> **[Re: \[Ask for help\] Questions about proxy\_cache and ssi](https://forum.nginx.org/read.php?2,243085,243089#msg-243089)**
>
> Hello list, I hava a nginx config problem , Please help look ! I use proxy\_cache and ssi. \*nginx config :\* ssi on; ssi\_silent\_errors on; ssi\_types text/shtml; proxy\_temp\_path /cache/proxy\_temp; proxy\_cache\_path /cache/pro

---

<div class="post-metadata">

**Author:** ![FoxBin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c0e974/32.png) [@FoxBin](https://www.ruby-forum.com/u/FoxBin)\
**Post date:** [September 25, 2013, 2:29pm UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669/4 "2013-09-25T14:29:16Z")

</div>

hi,mex :

this is my nginx config:

user nobody;  
worker\_rlimit\_nofile 65500;  
worker\_processes 8;  
error\_log logs/error.log;

events {  
use epoll;  
worker\_connections 65500;  
}

http {  
include mime.types;  
default\_type application/octet-stream;  
sendfile on;  
keepalive\_timeout 65;  
gzip off;  
client\_max\_body\_size 1g;  
proxy\_redirect off;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;

```
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
index index.shtml index.html index.htm;

access_log logs/access.log ;

proxy_temp_path /cache/proxy_temp;
proxy_cache_path /cache/proxy_cache levels=1:2 

```

keys\_zone=tmp\_cache:2000m  
inactive=10000d max\_size=200G;  
proxy\_next\_upstream error timeout invalid\_header http\_504 http\_500  
http\_502 http\_503;

```
upstream backend {
    server 192.168.1.100;
    server 192.168.1.101;
    server 192.168.1.102 backup;

```

}

```
server {
        server_name www.x.com ;

        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://backend;
            proxy_cache tmp_cache;
            proxy_cache_key $host$uri;
            proxy_cache_valid 1000d;
        }

        location ~ /purge(/.*) {
            allow 192.168.1.254;
            deny all;
            proxy_cache_purge tmp_cache $host$1$is_args$args;
        }

```

}

shtml files:  
[www.x.com/1.shtml](http://www.x.com/1.shtml)  
[www.x.com/2.shtml](http://www.x.com/2.shtml)  
[www.x.com/3.shtml](http://www.x.com/3.shtml)  
[www.x.com/4.shtml](http://www.x.com/4.shtml)  
[www.x.com/5.shtml](http://www.x.com/5.shtml)  
[www.x.com/6.shtml](http://www.x.com/6.shtml)  
…more

include files:  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html) old, i am include info  
!

Edit this file: [http://www.x.com/include/include/foot.html](http://www.x.com/include/include/foot.html) new,  
i  
am include info ! \<\html\>

I use ngx\_cache\_purge to clear the cache :  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html)

But do not take effect cache these pages :  
open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

old, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

old, i am include info ! \<\html\>

I have to clear the cache in order to take effect :  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)

open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

hello world1 ! new, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

hello world2 ! new, i am include info ! \<\html\>

If I have a lot shtml files ,Must be more clear the cache ☹  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)  
[http://www.x.com/purge/3.shtml](http://www.x.com/purge/3.shtml)  
[http://www.x.com/purge/4.shtml](http://www.x.com/purge/4.shtml)  
[http://www.x.com/purge/5.shtml](http://www.x.com/purge/5.shtml)  
[http://www.x.com/purge/6.shtml](http://www.x.com/purge/6.shtml)  
…more

I just need to clear a cache: [http://x.com/purge/include/foot.html](http://x.com/purge/include/foot.html) , all  
SHTML pages to take effect.

Is there a way to solve?

Thanks in advance 🙂

Posted at Nginx Forum:

> **[Re: \[Ask for help\] Questions about proxy\_cache and ssi](https://forum.nginx.org/read.php?2,243085,243088#msg-243088)**
>
> Hello list, I hava a nginx config problem , Please help look ! I use proxy\_cache and ssi. \*nginx config :\* ssi on; ssi\_silent\_errors on; ssi\_types text/shtml; proxy\_temp\_path /cache/proxy\_temp; proxy\_cache\_path /cache/pro

---

<div class="post-metadata">

**Author:** ![FoxBin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c0e974/32.png) [@FoxBin](https://www.ruby-forum.com/u/FoxBin)\
**Post date:** [September 25, 2013, 2:29pm UTC](https://www.ruby-forum.com/t/questions-about-proxy-cache-and-ssi/236669/5 "2013-09-25T14:29:52Z")

</div>

hi,mex :

this is my nginx config:

user nobody;  
worker\_rlimit\_nofile 65500;  
worker\_processes 8;  
error\_log logs/error.log;

events {  
use epoll;  
worker\_connections 65500;  
}

http {  
include mime.types;  
default\_type application/octet-stream;  
sendfile on;  
keepalive\_timeout 65;  
gzip off;  
client\_max\_body\_size 1g;  
proxy\_redirect off;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;

```
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
index index.shtml index.html index.htm;

access_log logs/access.log ;

proxy_temp_path /cache/proxy_temp;
proxy_cache_path /cache/proxy_cache levels=1:2 

```

keys\_zone=tmp\_cache:2000m  
inactive=10000d max\_size=200G;  
proxy\_next\_upstream error timeout invalid\_header http\_504 http\_500  
http\_502 http\_503;

```
upstream backend {
    server 192.168.1.100;
    server 192.168.1.101;
    server 192.168.1.102 backup;

```

}

```
server {
        server_name www.x.com ;

        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://backend;
            proxy_cache tmp_cache;
            proxy_cache_key $host$uri;
            proxy_cache_valid 1000d;
        }

        location ~ /purge(/.*) {
            allow 192.168.1.254;
            deny all;
            proxy_cache_purge tmp_cache $host$1$is_args$args;
        }

```

}

shtml files:  
[www.x.com/1.shtml](http://www.x.com/1.shtml)  
[www.x.com/2.shtml](http://www.x.com/2.shtml)  
[www.x.com/3.shtml](http://www.x.com/3.shtml)  
[www.x.com/4.shtml](http://www.x.com/4.shtml)  
[www.x.com/5.shtml](http://www.x.com/5.shtml)  
[www.x.com/6.shtml](http://www.x.com/6.shtml)  
…more

include files:  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html) old, i am include info  
!

Edit this file: [http://www.x.com/include/include/foot.html](http://www.x.com/include/include/foot.html) new,  
i  
am include info ! \<\html\>

I use ngx\_cache\_purge to clear the cache :  
[http://www.x.com/purge/include/foot.html](http://www.x.com/purge/include/foot.html)

But do not take effect cache these pages :  
open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

old, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

old, i am include info ! \<\html\>

I have to clear the cache in order to take effect :  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)

open [http://www.x.com/1.shtml](http://www.x.com/1.shtml)  
the content is :

hello world1 ! new, i am include info ! \<\html\>

open [http://www.x.com/2.shtml](http://www.x.com/2.shtml)  
the content is :

hello world2 ! new, i am include info ! \<\html\>

If I have a lot shtml files ,Must be more clear the cache ☹  
[http://www.x.com/purge/1.shtml](http://www.x.com/purge/1.shtml)  
[http://www.x.com/purge/2.shtml](http://www.x.com/purge/2.shtml)  
[http://www.x.com/purge/3.shtml](http://www.x.com/purge/3.shtml)  
[http://www.x.com/purge/4.shtml](http://www.x.com/purge/4.shtml)  
[http://www.x.com/purge/5.shtml](http://www.x.com/purge/5.shtml)  
[http://www.x.com/purge/6.shtml](http://www.x.com/purge/6.shtml)  
…more

I just need to clear a cache: [http://x.com/purge/include/foot.html](http://x.com/purge/include/foot.html) , all  
SHTML pages to take effect.

Is there a way to solve?

Thanks in advance 🙂

Posted at Nginx Forum:

> **[Re: \[Ask for help\] Questions about proxy\_cache and ssi](https://forum.nginx.org/read.php?2,243085,243090#msg-243090)**
>
> Hello list, I hava a nginx config problem , Please help look ! I use proxy\_cache and ssi. \*nginx config :\* ssi on; ssi\_silent\_errors on; ssi\_types text/shtml; proxy\_temp\_path /cache/proxy\_temp; proxy\_cache\_path /cache/pro
