Index: modules/trac/templates/site.erb |
=================================================================== |
--- a/modules/trac/templates/site.erb |
+++ b/modules/trac/templates/site.erb |
@@ -1,18 +1,40 @@ |
server { |
server_name <%= @domain %>; |
+ |
<% if is_default %> |
listen 80 default_server; |
listen [::]:80 default_server; |
<% else %> |
listen 80; |
listen [::]:80; |
<% end %> |
+ location / { |
+ rewrite (.*) https://$host$1 permanent; |
+ } |
+} |
+ |
+server { |
+ server_name <%= @domain %>; |
+ |
+ <% if is_default %> |
+ listen 443 ssl default_server; |
+ listen [::]:443 ssl default_server; |
+ <% else %> |
+ listen 443 ssl; |
+ listen [::]:443 ssl; |
+ <% end %> |
+ |
+ ssl_certificate adblockplus.org_sslcert.pem; |
+ ssl_certificate_key adblockplus.org_sslcert.key; |
+ |
+ add_header Strict-Transport-Security max-age=31536000; |
+ |
location / |
{ |
set $path_info $request_uri; |
if ($path_info ~ "(.*?)\?") |
{ |
set $path_info $1; |
} |