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

FR: Redirect serve HTTP requests to HTTPS via flag #13400

Open
shayne opened this issue Sep 6, 2024 · 2 comments · May be fixed by #13397
Open

FR: Redirect serve HTTP requests to HTTPS via flag #13400

shayne opened this issue Sep 6, 2024 · 2 comments · May be fixed by #13397
Labels
fr Feature request needs-triage

Comments

@shayne
Copy link
Contributor

shayne commented Sep 6, 2024

What are you trying to do?

I want requests to http://node or http://node.tailnet.ts.net to automatically redirect to https://node.tailnet.ts.net for improved ergonomics.

How should we solve this?

Add a --promote-https flag to the tailscale serve command, which automatically redirects HTTP requests on port 80 to HTTPS.

What is the impact of not solving this?

Without this feature, running serve in default mode only listens on HTTPS (port 443), so any requests made to HTTP (port 80) result in a “connection refused” error.

Anything else?

No.

@shayne shayne added fr Feature request needs-triage labels Sep 6, 2024
shayne added a commit to shayne/tailscale that referenced this issue Sep 6, 2024
Added a new `--promote-https` flag to `tailscale
serve`, allowing HTTP requests to be redirected to
HTTPS. This feature helps in scenarios where users
access `http://mynode`, which will now
automatically redirect to
`https://mynode.my-tailnet.ts.net`. The flag can
be toggled to enable or disable this redirect
behavior. Also included necessary changes to
manage redirect handlers for HTTP-to-HTTPS
promotion.

Closes tailscale#13400

Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
@wbste
Copy link

wbste commented Oct 30, 2024

Any updates on this? Seems like an excellent fix to an annoying issue...

@danpalmer
Copy link

https://github.com/tailscale/tailscale/blob/main/ipn/serve.go#L160C1-L162C1

Looks like @bradfitz originally thought this could be a good idea when implementing this. I've just gone looking for this, as I'd like to be able to have foo in my browser end up on https://foo.tailfoo.ts.net/, and I don't think that's quite possible without either having the application or another reverse proxy do that redirect for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fr Feature request needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants