

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
11 messages in ru.sysoev.nginxRe: question about proxy_store| From | Sent On | Attachments |
|---|---|---|
| eliott | Jan 26, 2008 7:18 pm | |
| Cliff Wells | Jan 27, 2008 9:10 pm | |
| eliott | Jan 27, 2008 10:13 pm | |
| Igor Sysoev | Jan 27, 2008 10:21 pm | |
| eliott | Jan 27, 2008 10:31 pm | |
| Igor Sysoev | Jan 27, 2008 10:58 pm | |
| Volodymyr Kostyrko | Jan 28, 2008 12:54 am | |
| Igor Sysoev | Jan 28, 2008 1:36 am | |
| Cliff Wells | Jan 28, 2008 2:11 am | |
| Volodymyr Kostyrko | Jan 28, 2008 2:49 am | |
| eliott | Jan 28, 2008 7:06 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: question about proxy_store | Actions... |
|---|---|---|
| From: | eliott (elio...@public.gmane.org) | |
| Date: | Jan 28, 2008 7:06:02 pm | |
| List: | ru.sysoev.nginx | |
I actually tested both methods presented above, and got them both to work.
######## method 1 was copied nearly verbatim from Igor's example. Thanks Igor!
location / { root /var/www/data/example.com/fetch; error_page 404 = /fetch$uri; }
location ^~ /fetch/ { internal; include proxy.conf; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:9001; proxy_store /var/www/data/example.com$uri; proxy_store_access user:rw group:rw all:r; }
location ~ /$ { index index.html; root /var/www/data/example.com/fetch; error_page 403 404 = @fetch; }
location @fetch { internal; include proxy.conf; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:9001; proxy_store /var/www/data/example.com/fetch${uri}index.html; proxy_store_access user:rw group:rw all:r; }
######## Method 2 required some minor adjustment Thanks Volodymyr!
location / { root /var/www/data/example.com/fetch; if (-f $request_filename/_cache.html) { rewrite (.*) $1/_cache.html; } error_page 403 404 = /fetch$uri; }
location ^~ /fetch/ { internal; include proxy.conf; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:9001; proxy_store /var/www/data/example.com${uri}_cache.html; proxy_store_access user:rw group:rw all:r; }
########
I am not sure which method is better. The first method results in a proper site structure that you could tar up and move to another box, or serve from another webserver, and it would be functional.
The second method is shorter and simpler, while it is tied more closely to custom rewrite rules and an odd file extension.
I think for now I want the first method, for the ability to be more highly portable. I can rsync the output around if I want to.
Thanks for all the help in this thread. It was a nice first experience on the mailing list for me. :)







