Nginx: Configure HSTs

Source: Internet
Author: User
Tags subdomain name

Refer:[Analysis of HSTs-blog] [http HSTs protocol and nginx-O & M survival time] [HSTs]


Header: strict-transport-Security

Strict-transport-security format

Strict-Transport-Security: <max-age=NUMBER>[; includeSubDomains][; preload]


  • Max-age: Unit: seconds. The expiration time of the HSTs header, generally set to 1 year, that is, 31536000 seconds. Each time the Response Header carries the HSTs header, the expiration time can be continuously refreshed.

  • Includesubdomains: The domain name/subdomain name of HSTs must be enabled.

  • Preload: This item must be set only when the browser's built-in preload list is added.


Nginx configuration example
server {    listen 80;    server_name xx.xx;    return 301 https://$host;}server{    listen       443 ssl;    server_name  xx.xx.xx;    ssl_certificate cert/xx.pem;    ssl_certificate_key cert/xx.key;    ....        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;    location  /{    }    ....}


Nginx: Configure HSTs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.