Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Added HTTPS redirect from www to base domain.

  • Loading branch information...
commit ee5a946b15cacfbc4448def353d01beddc208169 1 parent b64e222
@perusio authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 sites-available/example.com.conf
View
21 sites-available/example.com.conf
@@ -89,6 +89,27 @@ 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 {
Please sign in to comment.
Something went wrong with that request. Please try again.