MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / UpdateRootProxyForAi

Method UpdateRootProxyForAi

agent/utils/nginx/components/server.go:293–339  ·  view source on GitHub ↗
(proxy []string)

Source from the content-addressed store, hash-verified

291}
292
293func (s *Server) UpdateRootProxyForAi(proxy []string) {
294 newDir := Directive{
295 Name: "location",
296 Parameters: []string{"/"},
297 Block: &Block{},
298 }
299 block := &Block{}
300 block.AppendDirectives(
301 &Directive{
302 Name: "proxy_buffering",
303 Parameters: []string{
304 "off",
305 },
306 },
307 &Directive{
308 Name: "proxy_cache",
309 Parameters: []string{
310 "off",
311 },
312 },
313 &Directive{
314 Name: "proxy_http_version",
315 Parameters: []string{
316 "1.1",
317 },
318 },
319 &Directive{
320 Name: "proxy_set_header",
321 Parameters: []string{
322 "Connection", "''",
323 },
324 },
325 &Directive{
326 Name: "chunked_transfer_encoding",
327 Parameters: []string{
328 "off",
329 },
330 },
331 &Directive{
332 Name: "proxy_pass",
333 Parameters: proxy,
334 },
335 )
336
337 newDir.Block = block
338 s.UpdateDirectiveBySecondKey("location", "/", newDir)
339}
340
341func (s *Server) UpdateRootLocation() {
342 newDir := Directive{

Callers 1

ConfigAIProxyFunction · 0.80

Calls 2

AppendDirectivesMethod · 0.95

Tested by

no test coverage detected