Skip to content

How to enable https with axum? #3181

Closed Answered by jplatte
YukiShiro1226 asked this question in Q&A
Discussion options

You must be logged in to vote

The most common solution is to not expose your Rust service directly to the internet, but put it behind a reverse proxy that does the TLS termination and forwards requests to the Rust service via plain http on some non-reserved port. There are many web servers with reverse proxy functionality (e.g. Apache httpd, nginx, Caddy) and also more specialized proxy-only servers (e.g. Traefik, haproxy) that can fill this role, and it's out of the scope of this project to recommend one of them.

If you do for some reason want to expose your Rust service to the internet directly, we have some TLS examples in this repo, and you can also check out the third-party axum-server crate.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YukiShiro1226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants