{"action":"closed","issue":{"url":"https://api.github.com/repos/TracyWebTech/django-revproxy/issues/39","labels_url":"https://api.github.com/repos/TracyWebTech/django-revproxy/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/TracyWebTech/django-revproxy/issues/39/comments","events_url":"https://api.github.com/repos/TracyWebTech/django-revproxy/issues/39/events","html_url":"https://github.com/TracyWebTech/django-revproxy/issues/39","id":72771290,"number":39,"title":"Need to handle base URL","user":{"login":"Timokasse","id":5197530,"avatar_url":"https://avatars.githubusercontent.com/u/5197530?v=3","gravatar_id":"","url":"https://api.github.com/users/Timokasse","html_url":"https://github.com/Timokasse","followers_url":"https://api.github.com/users/Timokasse/followers","following_url":"https://api.github.com/users/Timokasse/following{/other_user}","gists_url":"https://api.github.com/users/Timokasse/gists{/gist_id}","starred_url":"https://api.github.com/users/Timokasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timokasse/subscriptions","organizations_url":"https://api.github.com/users/Timokasse/orgs","repos_url":"https://api.github.com/users/Timokasse/repos","events_url":"https://api.github.com/users/Timokasse/events{/privacy}","received_events_url":"https://api.github.com/users/Timokasse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-03T08:23:47Z","updated_at":"2015-06-06T12:01:49Z","closed_at":"2015-06-06T12:01:49Z","body":"Hello,\r\n\r\nLet's say you want to have `http://myproxy/toto.html` redirect  to `http://proxied/toto.html`. Then a simple `url(r'^(?P<path>.*)$', ProxyView.as_view(upstream='http://proxied/'))` will do the trick. And the static files in the page will also work properly. It will, for example refer to `http://myproxy/css/default.css` properly.\r\n\r\nNow you may want to have a base URL because this proxy will work for more than one site, for example. You would want something like this:\r\n\r\n    url(r'^app1/(?P<path>.*)$', ProxyView.as_view(upstream='http://hostapp1/')),\r\n    url(r'^app2/(?P<path>.*)$', ProxyView.as_view(upstream='http://hostapp2/')),\r\n\r\nBut it doesn't work because all static files will forget about the base url `app1` or `app2`. So the page `http://myproxy/app1/toto.html` will refer to `http://myproxy/css/default.css` instead of `http://myproxy/app1/css/default.css`.\r\n\r\nPlease add the possibility to handle this in `revproxy`.\r\n\r\nThanks,\r\nTimok"}}