Comment 2 for bug 1190625

Revision history for this message
clayg (clay-gerrard) wrote :

I can confirm this bug exists, the static-web redirect has no knowledge of the rewritten request and the remapping middleware(s) don't fix the response.

To reproduce I added the following to my proxy-server.conf:

    [pipeline:main]
    pipeline = catch_errors proxy-logging healthcheck cache cname_lookup domain_remap tempauth staticweb proxy-logging proxy-server

    [filter:cname_lookup]
    use = egg:swift#cname_lookup
    storage_domain = clayg.example.com

    [filter:domain_remap]
    use = egg:swift#domain_remap
    storage_domain = clayg.example.com

    [filter:staticweb]
    use = egg:swift#staticweb

I added a CNAME to DNS service* pointed to:

    page.auth_test.clayg.example.com

Then added an entry to my /etc/hosts:

    <ip.of.my.saio> page.auth_test.clayg.example.com

Then when I point my browser at "cname.mydomain.com" dns sends me to "page.auth_test.clayg.example.com" and hits the ip of my swift-all-in-one with the Host header still set to "cname.mydomain.com". The cname_lookup middleware translates the Host header in place to "page.auth_test.clayg.example.com" and domain_remap mangles the path w/o touching the Host resulting in "page.auth_test.clayg.example.com/v1/AUTH_test/page" (the trailing slash is *always* removed) which staticweb redirects to "page.auth_test.clayg.example.com/v1/AUTH_test/page/"

* I used GoDaddy, if your service is better you could try a wildcard CNAME or if you can spin up a caching name server (or if your router already has one) - you might be able to do something fancy.