feat: custom nginx conf dir path #62

This commit is contained in:
0xJacky 2023-01-11 14:05:51 +08:00
parent 7a98c16535
commit 02fb07f6b4
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
12 changed files with 625 additions and 615 deletions

View file

@ -13,7 +13,6 @@ import (
"log"
"net/http"
"os"
"path/filepath"
)
const (
@ -107,7 +106,7 @@ func getLogPath(control *controlStruct) (logPath string, err error) {
switch control.Type {
case "site":
var config *nginx.NgxConfig
path := filepath.Join(nginx.GetNginxConfPath("sites-available"), control.ConfName)
path := nginx.GetConfPath("sites-available", control.ConfName)
config, err = nginx.ParseNgxConfig(path)
if err != nil {
err = errors.Wrap(err, "error parsing ngx config")