Enable HTTP Strict Transport Security (HSTS) in Azure WebRoles
问题 How can I turn on HTTP Strict Transport Security (HSTS) for Azure WebRoles? 回答1: The accepted answer is confusing and the correct answer (on ServerFault) is hidden in the comments, so I'll just recap it quickly here. Basically this is what you want to do: Redirect all HTTP requests to HTTPS Add the Strict-Transport-Security header to all HTTPS requests The appropriate web.config would look like this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules>