Add redirect to https feature.

This commit is contained in:
bohung committed 2021-04-19 20:35:16 +08:00
1 parent 951aef1b72
commit c18df6dd78
7 files changed
+50 -11

No files matched your search

+5
View File
@@ -131,6 +131,11 @@ namespace :create_site do
site_cert.save
site_construct.update(:site_cert=>site_cert)
end
if nginx_file_content.match(/\s*return\s+30[12]\s+https:\/\/\$host\$request_uri\s*;/)
site_construct.update(:redirect_to_https => true)
else
site_construct.update(:redirect_to_https => false)
end
end
end
end