Skip to content

Commit

Permalink
* Added HTTPS redirect from www to base domain.
Browse files Browse the repository at this point in the history
  • Loading branch information
António P. P. Almeida committed Dec 2, 2012
1 parent 12a3206 commit e498c4b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sites-available/example.com.conf
Expand Up @@ -107,6 +107,28 @@ server {
} # HTTP 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. ## HTTPS server.
server { server {
listen 443 ssl; listen 443 ssl;
Expand Down

0 comments on commit e498c4b

Please sign in to comment.