Code Monkey home page Code Monkey logo

Comments (2)

lucaslorentz avatar lucaslorentz commented on July 3, 2024

Basically, any labels with caddy prefix will be converted to config.

That conversion support:

  • interpolation to get properties from docker service object
  • arrays, multiple configs with same name. Suffixes _0, _1, _2 are ignored in labels, so you can use them to create 2 configs with same name

Check this test for examples:
https://github.com/lucaslorentz/caddy-docker-proxy/blob/master/plugin/generator_test.go#L17

Besides the automatic label to config conversion, there are 3 special labels: caddy.address, caddy.targetport, caddy.targetpath. They are shortcuts to avoid interpolation. So both configurations below are equivalent.

caddy.address: testdomain.com
caddy.targetport: 5000
caddy.targetpath: /api

and

caddy: testdomain.com
caddy.proxy: / {{.Spec.Name}}:5000/api

So, answering your request, just use label websocket equals empty and it should work.
"caddy.proxy.websocket="

I will move this information to README later.

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on July 3, 2024

It's possible to write any configuration using labels, like:

caddy.limits=7500

will generate:

limits 7500

And

caddy.limits.header=100KB
caddy.limits.body_0=/upload 100MB
caddy.limits.body_1=/profile 25KB
caddy.limits.body_2=/api 10KB

will generate:

limits {
	header 100KB
	body   /upload 100MB
	body   /profile 25KB
	body   /api 10KB
}

from caddy-docker-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.