mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
.. | ||
src | ||
Cargo.toml | ||
cert.pem | ||
key.pem | ||
README.md |
Middleware: Redirect Any HTTP Connection To Use HTTPS Connection
This example is the next step after implementing this example : Setup TLS via rustls.
You might have already implemented TLS (using one of the ways mentioned in the example of security section), and have setup your server to listen to port 443 (for HTTPS).
Now, the only problem left to solve is, to listen to HTTP connections as well and redirect them to use HTTPS
Usage
cd middleware/middleware-http-to-https
cargo run
Notes
Also see redirect_to_https
from actix-web-lab
.