server { listen 80 default_server; listen [::]:80 default_server; server_name bw.kylespearrin.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name bw.kylespearrin.com; ssl_certificate /etc/letsencrypt/live/bw.kylespearrin.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/bw.kylespearrin.com/privkey.pem; ssl_session_timeout 30m; ssl_session_cache shared:SSL:20m; ssl_session_tickets off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /etc/letsencrypt/live/bw.kylespearrin.com/dhparam.pem; # SSL protocols TLS v1~TLSv1.2 are allowed. Disabed SSLv3 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Disabled insecure ciphers suite. For example, MD5, DES, RC4, PSK ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4:@STRENGTH"; # enables server-side protection from BEAST attacks ssl_prefer_server_ciphers on; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /etc/letsencrypt/live/bw.kylespearrin.com/fullchain.pem; resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=300s; # Headers # X-Frame-Options is to prevent from clickJacking attack #add_header X-Frame-Options SAMEORIGIN; # disable content-type sniffing on some browsers. add_header X-Content-Type-Options nosniff; # This header enables the Cross-site scripting (XSS) filter add_header X-XSS-Protection "1; mode=block"; # This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack #add_header Strict-Transport-Security max-age=15768000; location /api/ { proxy_pass http://api/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Url-Scheme $scheme; proxy_redirect off; } location /identity/ { proxy_pass http://identity/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Url-Scheme $scheme; proxy_redirect off; } }