1Panel/backend/app/dto/nginx.go

51 lines
1.1 KiB
Go
Raw Normal View History

2022-11-07 08:19:05 +00:00
package dto
2022-11-30 16:41:50 +00:00
import (
"github.com/1Panel-dev/1Panel/backend/app/model"
"github.com/1Panel-dev/1Panel/backend/utils/nginx/components"
)
type NginxFull struct {
Install model.AppInstall
2022-12-13 09:20:13 +00:00
Website model.Website
2022-11-30 16:41:50 +00:00
ConfigDir string
ConfigFile string
SiteDir string
Dir string
RootConfig NginxConfig
SiteConfig NginxConfig
}
2022-11-07 08:19:05 +00:00
type NginxConfig struct {
2022-12-13 10:54:46 +00:00
FilePath string
Config *components.Config
OldContent string
2022-11-07 08:19:05 +00:00
}
2022-12-13 10:54:46 +00:00
type NginxParam struct {
UpdateScope string
Name string
Params []string
2022-11-24 08:06:18 +00:00
}
2022-11-24 02:28:39 +00:00
type NginxKey string
2022-11-07 08:19:05 +00:00
const (
2022-11-24 02:28:39 +00:00
Index NginxKey = "index"
LimitConn NginxKey = "limit-conn"
SSL NginxKey = "ssl"
HttpPer NginxKey = "http-per"
2022-11-08 07:42:31 +00:00
)
2022-11-24 02:28:39 +00:00
var ScopeKeyMap = map[NginxKey][]string{
2022-11-08 07:42:31 +00:00
Index: {"index"},
LimitConn: {"limit_conn", "limit_rate", "limit_conn_zone"},
2022-11-16 02:31:35 +00:00
SSL: {"ssl_certificate", "ssl_certificate_key"},
2022-11-24 02:28:39 +00:00
HttpPer: {"server_names_hash_bucket_size", "client_header_buffer_size", "client_max_body_size", "keepalive_timeout", "gzip", "gzip_min_length", "gzip_comp_level"},
2022-11-08 07:42:31 +00:00
}
2022-11-30 16:41:50 +00:00
var StaticFileKeyMap = map[NginxKey]struct {
2022-11-08 07:42:31 +00:00
}{
SSL: {},
2022-11-08 07:42:31 +00:00
}