Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slash domain redirect url? #125

Open
lephyrius opened this issue Aug 16, 2016 · 3 comments
Open

Trailing slash domain redirect url? #125

lephyrius opened this issue Aug 16, 2016 · 3 comments
Labels

Comments

@lephyrius
Copy link

I want to proxy the requests through another domain.(CDN)
The problem is that the it redirects to the underlying server domain address and not the domain that the CDN uses.

@lephyrius lephyrius changed the title Trailing slash redirect url? Trailing slash domain redirect url? Aug 16, 2016
@Hoverbear
Copy link

Hoverbear commented Aug 16, 2016

Can you give some solid examples? (Show example URLs?)

@lephyrius
Copy link
Author

lephyrius commented Aug 16, 2016

CDN: http://www.example.com/
Server: http://www.server.com/

Let's say the client Requests:
GET http://www.example.com/hello/123/

The response will be then:

HTTP/1.1 301 Moved Permanently
Location: http://www.server.com/hello/123
Date: Tue, 16 Aug 2016 09:39:39 GMT
Content-Length: 0

How do I specify so that the redirect uses: http://www.example.com/

@untitaker
Copy link
Member

I don't understand. If the client requests the file from a CDN, why would the requests hit your server?

If you want to change the used hostname, the way to do this is to define a BeforeMiddleware that changes request.url accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants