Skip to content

Instantly share code, notes, and snippets.

@non7top
Last active January 15, 2017 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save non7top/b44c3b5b2bfce99bff86 to your computer and use it in GitHub Desktop.
Save non7top/b44c3b5b2bfce99bff86 to your computer and use it in GitHub Desktop.
Example configuration for nginx
location /rdiffweb {
rewrite ^([^\?#]*/)([^\?#\./]+)([\?#].*)?$ $1$2/$3 permanent;
# substitute with rdiffweb url
proxy_pass http://127.0.0.1:18080/;
# for https
#proxy_redirect http://example.com https://example.com/rdiffweb;
proxy_set_header Host $host;
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 $scheme;
proxy_set_header Accept-Encoding "";
# rewrite internal links
sub_filter 'href="/' 'href="/rdiffweb/';
sub_filter 'src="/' 'src="/rdiffweb/';
sub_filter 'action="/' 'action="/rdiffweb/';
sub_filter "url(\'/static" "url(\'/rdiffweb/static";
sub_filter_types "*";
sub_filter_once off;
}
@sophieforceno
Copy link

There's a typo in the proxy_pass directive. The default address is: proxy_pass http://127.0.0.1:8080/;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment