Last active
January 15, 2017 00:43
-
-
Save non7top/b44c3b5b2bfce99bff86 to your computer and use it in GitHub Desktop.
Example configuration for nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a typo in the
proxy_pass
directive. The default address is:proxy_pass http://127.0.0.1:8080/;