|
|
@ -536,6 +536,10 @@ func opWebsite(website *model.Website, operate string) error { |
|
|
|
if files.NewFileOp().Stat(absoluteRewritePath) { |
|
|
|
if files.NewFileOp().Stat(absoluteRewritePath) { |
|
|
|
server.UpdateDirective("include", []string{rewriteInclude}) |
|
|
|
server.UpdateDirective("include", []string{rewriteInclude}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
rootIndex := path.Join("/www/sites", website.Alias, "index") |
|
|
|
|
|
|
|
if website.SiteDir != "/" { |
|
|
|
|
|
|
|
rootIndex = path.Join(rootIndex, website.SiteDir) |
|
|
|
|
|
|
|
} |
|
|
|
switch website.Type { |
|
|
|
switch website.Type { |
|
|
|
case constant.Deployment: |
|
|
|
case constant.Deployment: |
|
|
|
server.RemoveDirective("root", nil) |
|
|
|
server.RemoveDirective("root", nil) |
|
|
@ -546,12 +550,11 @@ func opWebsite(website *model.Website, operate string) error { |
|
|
|
proxy := fmt.Sprintf("http://127.0.0.1:%d", appInstall.HttpPort) |
|
|
|
proxy := fmt.Sprintf("http://127.0.0.1:%d", appInstall.HttpPort) |
|
|
|
server.UpdateRootProxy([]string{proxy}) |
|
|
|
server.UpdateRootProxy([]string{proxy}) |
|
|
|
case constant.Static: |
|
|
|
case constant.Static: |
|
|
|
server.UpdateRoot(path.Join("/www/sites", website.Alias, "index")) |
|
|
|
server.UpdateRoot(rootIndex) |
|
|
|
server.UpdateRootLocation() |
|
|
|
server.UpdateRootLocation() |
|
|
|
case constant.Proxy: |
|
|
|
case constant.Proxy: |
|
|
|
server.RemoveDirective("root", nil) |
|
|
|
server.RemoveDirective("root", nil) |
|
|
|
case constant.Runtime: |
|
|
|
case constant.Runtime: |
|
|
|
rootIndex := path.Join("/www/sites", website.Alias, "index") |
|
|
|
|
|
|
|
server.UpdateRoot(rootIndex) |
|
|
|
server.UpdateRoot(rootIndex) |
|
|
|
localPath := "" |
|
|
|
localPath := "" |
|
|
|
if website.ProxyType == constant.RuntimeProxyUnix { |
|
|
|
if website.ProxyType == constant.RuntimeProxyUnix { |
|
|
|