Skip to content

Commit 1ba1da0

Browse files
committed
chore: use nginx.GetConfEntryPath() #1013
1 parent a75a5b7 commit 1ba1da0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

internal/cache/index.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
348348
if strings.Contains(includePath, "*") {
349349
// If it's a relative path, make it absolute based on nginx config dir
350350
if !filepath.IsAbs(includePath) {
351-
configDir := filepath.Dir(nginx.GetConfPath("", ""))
351+
configDir := filepath.Dir(nginx.GetConfPath())
352352
includePath = filepath.Join(configDir, includePath)
353353
}
354354

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

@@ -413,7 +413,7 @@ func (s *Scanner) ScanAllConfigs() error {
413413
}()
414414

415415
// Get the main config file
416-
mainConfigPath := nginx.GetConfPath("", "nginx.conf")
416+
mainConfigPath := nginx.GetConfEntryPath()
417417
err := s.scanSingleFile(mainConfigPath)
418418
if err != nil {
419419
logger.Error("Failed to scan main config:", err)

internal/performance/config_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func GetNginxWorkerConfigInfo() (*NginxConfigInfo, error) {
5151
},
5252
}
5353

54-
confPath := nginx.GetConfPath("nginx.conf")
54+
confPath := nginx.GetConfEntryPath()
5555
if confPath == "" {
5656
return nil, errors.New("failed to get nginx.conf path")
5757
}

internal/performance/perf_opt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type PerfOpt struct {
5353

5454
// UpdatePerfOpt updates the Nginx performance optimization settings
5555
func UpdatePerfOpt(opt *PerfOpt) error {
56-
confPath := nginx.GetConfPath("nginx.conf")
56+
confPath := nginx.GetConfEntryPath()
5757
if confPath == "" {
5858
return errors.New("failed to get nginx.conf path")
5959
}

0 commit comments

Comments
 (0)