mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
chore: use nginx.GetConfEntryPath() #1013
This commit is contained in:
parent
a75a5b7429
commit
1ba1da0d5d
3 changed files with 5 additions and 5 deletions
6
internal/cache/index.go
vendored
6
internal/cache/index.go
vendored
|
@ -348,7 +348,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
|
||||||
if strings.Contains(includePath, "*") {
|
if strings.Contains(includePath, "*") {
|
||||||
// If it's a relative path, make it absolute based on nginx config dir
|
// If it's a relative path, make it absolute based on nginx config dir
|
||||||
if !filepath.IsAbs(includePath) {
|
if !filepath.IsAbs(includePath) {
|
||||||
configDir := filepath.Dir(nginx.GetConfPath("", ""))
|
configDir := filepath.Dir(nginx.GetConfPath())
|
||||||
includePath = filepath.Join(configDir, includePath)
|
includePath = filepath.Join(configDir, includePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ func (s *Scanner) scanSingleFile(filePath string) error {
|
||||||
// Handle single file include
|
// Handle single file include
|
||||||
// If it's a relative path, make it absolute based on nginx config dir
|
// If it's a relative path, make it absolute based on nginx config dir
|
||||||
if !filepath.IsAbs(includePath) {
|
if !filepath.IsAbs(includePath) {
|
||||||
configDir := filepath.Dir(nginx.GetConfPath("", ""))
|
configDir := filepath.Dir(nginx.GetConfPath())
|
||||||
includePath = filepath.Join(configDir, includePath)
|
includePath = filepath.Join(configDir, includePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ func (s *Scanner) ScanAllConfigs() error {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Get the main config file
|
// Get the main config file
|
||||||
mainConfigPath := nginx.GetConfPath("", "nginx.conf")
|
mainConfigPath := nginx.GetConfEntryPath()
|
||||||
err := s.scanSingleFile(mainConfigPath)
|
err := s.scanSingleFile(mainConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Failed to scan main config:", err)
|
logger.Error("Failed to scan main config:", err)
|
||||||
|
|
|
@ -51,7 +51,7 @@ func GetNginxWorkerConfigInfo() (*NginxConfigInfo, error) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
confPath := nginx.GetConfPath("nginx.conf")
|
confPath := nginx.GetConfEntryPath()
|
||||||
if confPath == "" {
|
if confPath == "" {
|
||||||
return nil, errors.New("failed to get nginx.conf path")
|
return nil, errors.New("failed to get nginx.conf path")
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ type PerfOpt struct {
|
||||||
|
|
||||||
// UpdatePerfOpt updates the Nginx performance optimization settings
|
// UpdatePerfOpt updates the Nginx performance optimization settings
|
||||||
func UpdatePerfOpt(opt *PerfOpt) error {
|
func UpdatePerfOpt(opt *PerfOpt) error {
|
||||||
confPath := nginx.GetConfPath("nginx.conf")
|
confPath := nginx.GetConfEntryPath()
|
||||||
if confPath == "" {
|
if confPath == "" {
|
||||||
return errors.New("failed to get nginx.conf path")
|
return errors.New("failed to get nginx.conf path")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue