1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00
examples/middleware/middleware-http-to-https
2022-02-25 21:08:53 +00:00
..
src use futures-util in more cases 2022-02-22 12:12:17 +00:00
Cargo.toml update actix web to stable version 2022-02-25 21:08:53 +00:00
cert.pem restructure folders 2022-02-18 02:01:48 +00:00
key.pem restructure folders 2022-02-18 02:01:48 +00:00
README.md fix static-files readme name 2022-02-18 03:36:04 +00:00

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.