@@ -536,6 +536,10 @@ func opWebsite(website *model.Website, operate string) error {
536536 if files .NewFileOp ().Stat (absoluteRewritePath ) {
537537 server .UpdateDirective ("include" , []string {rewriteInclude })
538538 }
539+ rootIndex := path .Join ("/www/sites" , website .Alias , "index" )
540+ if website .SiteDir != "/" {
541+ rootIndex = path .Join (rootIndex , website .SiteDir )
542+ }
539543 switch website .Type {
540544 case constant .Deployment :
541545 server .RemoveDirective ("root" , nil )
@@ -546,12 +550,11 @@ func opWebsite(website *model.Website, operate string) error {
546550 proxy := fmt .Sprintf ("http://127.0.0.1:%d" , appInstall .HttpPort )
547551 server .UpdateRootProxy ([]string {proxy })
548552 case constant .Static :
549- server .UpdateRoot (path . Join ( "/www/sites" , website . Alias , "index" ) )
553+ server .UpdateRoot (rootIndex )
550554 server .UpdateRootLocation ()
551555 case constant .Proxy :
552556 server .RemoveDirective ("root" , nil )
553557 case constant .Runtime :
554- rootIndex := path .Join ("/www/sites" , website .Alias , "index" )
555558 server .UpdateRoot (rootIndex )
556559 localPath := ""
557560 if website .ProxyType == constant .RuntimeProxyUnix {
0 commit comments