Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/cache/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
if strings.Contains(includePath, "*") {
// If it's a relative path, make it absolute based on nginx config dir
if !filepath.IsAbs(includePath) {
configDir := filepath.Dir(nginx.GetConfPath("", ""))
configDir := filepath.Dir(nginx.GetConfPath())
includePath = filepath.Join(configDir, includePath)
}

Expand All @@ -373,7 +373,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
// Handle single file include
// If it's a relative path, make it absolute based on nginx config dir
if !filepath.IsAbs(includePath) {
configDir := filepath.Dir(nginx.GetConfPath("", ""))
configDir := filepath.Dir(nginx.GetConfPath())
includePath = filepath.Join(configDir, includePath)
}

Expand Down Expand Up @@ -413,7 +413,7 @@ func (s *Scanner) ScanAllConfigs() error {
}()

// Get the main config file
mainConfigPath := nginx.GetConfPath("", "nginx.conf")
mainConfigPath := nginx.GetConfEntryPath()
err := s.scanSingleFile(mainConfigPath)
if err != nil {
logger.Error("Failed to scan main config:", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/performance/config_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func GetNginxWorkerConfigInfo() (*NginxConfigInfo, error) {
},
}

confPath := nginx.GetConfPath("nginx.conf")
confPath := nginx.GetConfEntryPath()
if confPath == "" {
return nil, errors.New("failed to get nginx.conf path")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/performance/perf_opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type PerfOpt struct {

// UpdatePerfOpt updates the Nginx performance optimization settings
func UpdatePerfOpt(opt *PerfOpt) error {
confPath := nginx.GetConfPath("nginx.conf")
confPath := nginx.GetConfEntryPath()
if confPath == "" {
return errors.New("failed to get nginx.conf path")
}
Expand Down
6 changes: 4 additions & 2 deletions resources/services/nginx-ui.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ CONFIG="/usr/local/etc/nginx-ui/app.ini"

start() {
echo "Starting $NAME..."
start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- $CONFIG
# BusyBox compatible syntax
start-stop-daemon -S -b -p $PIDFILE -m -x $DAEMON -- $CONFIG
echo "$NAME started"
}

stop() {
echo "Stopping $NAME..."
start-stop-daemon --stop --pidfile $PIDFILE --retry 10
# BusyBox compatible syntax
start-stop-daemon -K -p $PIDFILE -R 10
rm -f $PIDFILE
echo "$NAME stopped"
}
Expand Down