This commit is contained in:
BoHung Chiu 2022-12-02 13:34:24 +08:00
parent 66412d3e40
commit baf9e093c6
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ namespace :create_site do
nginx_include_dir = nginx_include_dir.gsub(/include|;|\n/,'').strip
domain_name = @site_server.domain_name#'serv.rulingcom.com'
server_names = exec_command_by_user(ssh,"grep -H 'server_name' -r #{nginx_include_dir}")
server_names_array = server_names.scan(/(.*):[ \t]*server_name[ \t]+(.*);/)
server_names_array = server_names.scan(/(.*):[ \t]*server_name[ \t]+([^;]+);/)
server_names_array = server_names_array.group_by{|v| v[0]}
server_names_array.each do |nginx_file, server_name_with_file|