修復錯誤

This commit is contained in:
邱博亞 2023-05-20 10:41:26 +08:00
parent 33be28d7ad
commit b3676761b4
1 changed files with 2 additions and 2 deletions

View File

@ -142,10 +142,10 @@ class SiteConstruct
if old_server_block.present? if old_server_block.present?
new_server_block = old_server_block.gsub('\n',"\n").gsub(/(listen\s+)[^;]+/){|ff| "#{$1}#{port_text}"} new_server_block = old_server_block.gsub('\n',"\n").gsub(/(listen\s+)[^;]+/){|ff| "#{$1}#{port_text}"}
if port_text == "80" if port_text == "80"
new_server_block = new_server_block.gsub(/^.*#\s*managed by Certbot(\n|$)/,'') new_server_block = new_server_block.gsub(/[ \t]*#\s*managed by Certbot/,'')
else else
if self.site_cert && !(self.site_cert.is_certbot) if self.site_cert && !(self.site_cert.is_certbot)
new_server_block = new_server_block.gsub(/#\s*managed by Certbot/,'') new_server_block = new_server_block.gsub(/[ \t]*#\s*managed by Certbot/,'')
end end
end end
new_server_block = new_server_block.gsub(/(server_name\s+)[^;]+/m){|ff| "#{$1}#{domain_name_str}"} new_server_block = new_server_block.gsub(/(server_name\s+)[^;]+/m){|ff| "#{$1}#{domain_name_str}"}