• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Nginx Configuration for HSTS Preload

By Abhishek Ghosh September 12, 2014 8:35 am Updated on September 15, 2014

Nginx Configuration for HSTS Preload

Advertisement

Chrome, Firefox, Safari will at least check a website in the list of HSTS Preloading. Here is the right Nginx configuration for HSTS preload. We have talked about What is HTTP Strict Transport Security (HSTS) Preload List in the previously published article. Here is the working Nginx Configuration for HSTS Preload Test Passing.

 

Nginx Configuration for HSTS Preload : Before We Begin

 

This configuration is for Rackspace Cloud and we use fully default settings of Nginx. You should read the previous guide – SSL Grade Optimization Tweak For Rackspace Cloud Server. Basically, 90% has been done on the older guides. Smaller tweak is required to get the thing we want. It is, very easy.

Nginx Configuration for HTTS Preload

 

Nginx Configuration for HSTS Preload

 

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples
server {
listen 80;
listen [::]:80 ipv6only=on;
 
# rest of the all stuffs will be here
# we skipped to HTTPS
# Includes HSTS Preload
}
 
# HTTPS server
#
server {
listen 443 ssl spdy default;
keepalive_timeout   70;
server_name thecustomizewindows.com;
server_tokens off;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
        root /usr/share/nginx/html;
        index index.php index.html index.htm;
     ssl on;
access_log off;
spdy_headers_comp 0;
     ssl_certificate /etc/nginx/ssl/thecustomizewindows.com.crt;
     ssl_certificate_key /etc/nginx/ssl/thecustomizewindows.com.key;
     ssl_dhparam /etc/nginx/ssl/dhparam.pem;
     ssl_session_timeout 10m;
     ssl_session_cache shared:NginxCache123:50m;
     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
     ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK';
ssl_prefer_server_ciphers on;
     ssl_stapling on;
     ssl_stapling_verify on;
     ssl_trusted_certificate /etc/nginx/ssl/signed_cert_plus_intermediate.crt;
resolver 8.8.8.8 8.8.4.4 valid=86400;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
        location ~ \.php$ {
        #       fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        #
        #       # With php5-cgi alone:
                # fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=101M";
                fastcgi_index index.php;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
include fastcgi_params;
 
# BEGIN W3TC stuffs
## W3C stuffs here
# END W3TC stuffs
 
        }
       location / {
               try_files $uri $uri/ /index.php;
       }
}
# if more thing exits will go here

All are discussed before. This is enough to get a A+ on SSLlabs test :

Advertisement

---

Vim
1
2
3
4
5
6
7
https://www.ssllabs.com/ssltest/analyze.html?d=thecustomizewindows.com
# this will give you
# our result, which is
  Certificate 100
  Protocol Support 95
  Key Exchange 90
  Cipher Strength 90

To generate the dhparam.pem file, you will run :

Vim
1
2
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# /etc/nginx/ssl/ is my path

Yes, security or grade can be increased more, but Windows and Internet Explorer will create problems :

Vim
1
https://www.ssllabs.com/ssltest/viewClient.html?name=IE&version=6&platform=XP

Tagged With hsts preload nginx , HSTS Preloading nginx , add preload nginx , controller config hsts-preload: true in nginx controller , g /usr/share/doc/nginx-doc/examples/ , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1838 5xwqHZCYw8RlXNY7QNOVr59tHNQdBN_SA_I-dKZJmHURsNjPdC8HSfkmf5xvKUTG b2d1432caf345732dc04fab00aec24e76bbcc0b5&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , Spring Attribute preload HSTS

This Article Has Been Shared 990 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Nginx Configuration for HSTS Preload

  • Cloud OS Installation on Rackspace Cloud Sites

    Cloud OS Installation on Rackspace Cloud Sites is quite simple process. In this guide we will show how to install free Cloud OS Eye OS for online collaboration.

  • Cloud as a Test Environment

    Cloud as a test environment for applications is an elegant idea in theory, but needs a thorough investigation of the security and privacy aspects.

  • Installing Python Application in OpenShift PaaS

    Installing Python Application in OpenShift PaaS needs some modification and custom commands as you might not able to run. Here are some tips for Python.

  • Install Open Journal Systems on Rackspace Cloud Sites

    Install Open Journal Systems on Rackspace Cloud Sites just like any other PHP MySQL based application in easy to follow steps.

  • Rackspace Deployment Services Early Access Video Guide

    Rackspace Deployment Services Early Access Video Guide Shows How to Setup Rackspace Cloud Server, Load Balancers, Cloud Database in easy clicks from GUI.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023
  • What is COB LED? How LED Chip On Board Works January 20, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Nginx Configuration for HSTS Preload," in The Customize Windows, September 12, 2014, January 27, 2023, https://thecustomizewindows.com/2014/09/nginx-configuration-htts-preload/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT