How to enable https with axum? #3181
-
SummaryI'm developing the web server using axum and I almost finished. axum version0.8.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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.