Welcome! Log In Create A New Profile

Advanced

how to setup as caching reverse proxy for/rewritign global URLs

All files from this thread

File Name File Size   Posted by Date  
smime.p7s 5.2 KB open | download Thomas Hartmann 02/20/2019 Read message
smime.p7s 5.2 KB open | download Thomas Hartmann 03/04/2019 Read message
Thomas Hartmann
February 20, 2019 06:38AM
Hi all,

I would like to setup Nginx as a caching reverse proxy but with explicit
requests in the URL and rewriting all subsequent requests

Don;t know, if it really counts as reverse proxy and if it is
understandable, so an example ;)

For an original URL like
https://org.url.baz/user/repo/foo
I would like to be able to cache all request through nginx running at
my.domain.foo
but with an explicit "cache request" like

wget http://my.domain.foo/cache/http://org.url.baz/user/repo/foo

and rewrite all subsequent request and cache them.

So, I am looking for something similar to Internet Archive's memento proxy

https://web.archive.org/save/https://mailman.nginx.org/pipermail/nginx/2019-February/thread.html

Since my idea is no 'true' reverse proxy, the example [1] needs probably
a bit of extension and I am not sure, how to do the rewrites.

So far my attempts [2] were not really successful - but then I have not
much experiences in that direction and would be grateful, if someone has
an idea for me?

Cheers and thanks,
Thomas


[1]
https://www.nginx.com/resources/wiki/start/topics/examples/reverseproxycachingexample/

[2]
http {
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m
inactive=1d max_size=10g;
server {
# server_name *;



location /cache {
rewrite ^(.*)$ /VirtualHostBase/cache$1 break;
proxy_pass http://127.0.0.1:8080;
proxy_cache_revalidate on;
proxy_buffering on;
proxy_cache STATIC;
proxy_ignore_headers Cache-Control;
proxy_cache_valid any 1d;
proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503 http_504;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
}
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Attachments:
open | download - smime.p7s (5.2 KB)
Subject Author Posted

how to setup as caching reverse proxy for/rewritign global URLs Attachments

Thomas Hartmann February 20, 2019 06:38AM

Re: how to setup as caching reverse proxy for/rewritign global URLs

Francis Daly March 03, 2019 05:56PM

RE: how to setup as caching reverse proxy for/rewritign global URLs

Reinis Rozitis March 04, 2019 06:58AM

Re: how to setup as caching reverse proxy for/rewritign global URLs Attachments

Thomas Hartmann March 04, 2019 09:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 163
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