Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Added HTTPS redirect from www to base domain.

commit e498c4bd17393e4510b8036e3014d14f442254a2 1 parent 12a3206
@perusio authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 sites-available/example.com.conf
View
22 sites-available/example.com.conf
@@ -107,6 +107,28 @@ server {
} # HTTP server
+## Return (no rewrite) server block.
+server {
+ ## This is to avoid the spurious if for sub-domain name
+ ## "rewriting".
+ listen 443; # IPv4
+ ## Replace the IPv6 address by your own address. The address below
+ ## was stolen from the wikipedia page on IPv6.
+ listen [fe80::202:b3ff:fe1e:8329]:443 ipv6only=on;
+ server_name www.example.com;
+
+ ## Keep alive timeout set to a greater value for SSL/TLS.
+ keepalive_timeout 75 75;
+
+ ## See the keepalive_timeout directive in nginx.conf.
+ ## Server certificate and key.
+ ssl_certificate /etc/ssl/certs/example-cert.pem;
+ ssl_certificate_key /etc/ssl/private/example.key;
+
+ return 301 $scheme://example.com$request_uri;
+
+} # server domain return.
+
## HTTPS server.
server {
listen 443 ssl;
Please sign in to comment.
Something went wrong with that request. Please try again.