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

redirect http to https in XAPI when you call the http(s)://<ip_server> #4856

Closed
benjamreis opened this issue Nov 24, 2022 · 1 comment
Closed

Comments

@benjamreis
Copy link
Contributor

Hi!

As said in the title, we'd like to redirect people accessing the homepage of host through http to https.
Are there, from the go, any problem with that that we're not aware of?

Thanks

@robhoes
Copy link
Member

robhoes commented Nov 25, 2022

Hi, I'm fine with that. However, we have now added an option to close port 80 completely, as some people prefer that for security reason. Port 80 is still open by default, but when closed, then the redirection won't work anymore, as nothing will be listening on port 80.

benjamreis added a commit to xcp-ng/xen-api that referenced this issue Nov 29, 2022
- Add `location` to `Http.Request.Hdr`
- Add `response_redirect` method to `http-svr`
- When `GET` is received by the fileserver and `website-https-only` is true:
    - if `host` is filled in the request, redirect towards the same URI but in HTTPS
    - if `host` is not present, reply with a forbidden as before

Solves xapi-project#4856

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
benjamreis added a commit to xcp-ng/xen-api that referenced this issue Nov 30, 2022
- Add `location` to `Http.Request.Hdr`
- Add `response_redirect` method to `http-svr`
- When `GET` is received by the fileserver and `website-https-only` is true:
    - if `host` is filled in the request, redirect towards the same URI but in HTTPS
    - if `host` is not present, reply with a forbidden as before

Solves xapi-project#4856

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
benjamreis added a commit to xcp-ng/xen-api that referenced this issue Dec 1, 2022
- Add `location` to `Http.Request.Hdr`
- Add `response_redirect` method to `http-svr`
- When `GET` is received by the fileserver and `website-https-only` is true:
    - if `host` is filled in the request, redirect towards the same URI but in HTTPS
    - if `host` is not present, reply with a forbidden as before

Solves xapi-project#4856

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants