Code Monkey home page Code Monkey logo

Comments (4)

lucaslorentz avatar lucaslorentz commented on August 24, 2024 1

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on August 24, 2024 1

You're completely right.
This is a regression, the suffix shouldn't be ignored.
I will create a PR addressing those issues.

from caddy-docker-proxy.

jtyr avatar jtyr commented on August 24, 2024

Thanks for the hint @lucaslorentz. Unfortunately it doesn't work as expected. This is my Compose file:

version: '3.2'

services:
  frontend:
    image: mycaddy
    labels:
      caddy_1: (myDefaults)
      caddy_1.log: / stdout

      caddy_2: (myTlsDefaults)
      caddy_2.import: myDefaults
      caddy_2.tls: self_signed
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

  backend:
    image: mycaddy
    labels:
      caddy_1: http://example.lan
      caddy_1.import: myDefaults
      caddy_1.redir: https://example.lan{uri}

      caddy_2.address: https://example.lan
      caddy_2.import: myTlsDefaults
      caddy_2.targetport: 2015
      caddy_2.proxy.keepalive: 0

and this is the log from the test_frontend service:

test_frontend.1.7w9l2vi0vioz@swarm01    | 2018/09/13 09:43:02 [ERROR] CaddyFile error: :2 - Error during parsing: File to import not found: myDefaults
test_frontend.1.7w9l2vi0vioz@swarm01    | 2018/09/13 09:43:02 [INFO] Wrong CaddyFile:
test_frontend.1.7w9l2vi0vioz@swarm01    | (myTlsDefaults) {
test_frontend.1.7w9l2vi0vioz@swarm01    |   import myDefaults
test_frontend.1.7w9l2vi0vioz@swarm01    |   redir https://example.lan{uri}
test_frontend.1.7w9l2vi0vioz@swarm01    |   tls self_signed
test_frontend.1.7w9l2vi0vioz@swarm01    | }
test_frontend.1.7w9l2vi0vioz@swarm01    | https://example.lan {
test_frontend.1.7w9l2vi0vioz@swarm01    |   import myTlsDefaults
test_frontend.1.7w9l2vi0vioz@swarm01    |   proxy / 10.0.0.4:2015 {
test_frontend.1.7w9l2vi0vioz@swarm01    |     keepalive 0
test_frontend.1.7w9l2vi0vioz@swarm01    |   }
test_frontend.1.7w9l2vi0vioz@swarm01    | }

It seems to ignore the _# suffix and only takes the last directive.

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on August 24, 2024

This will be a breaking change on next version:
#70

Use caddy label instead of caddy.address to avoid generating proxy directive.

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.