Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring Traefik middleware such as StripPrefix #825

Open
mhrlife opened this issue Dec 6, 2024 · 2 comments
Open

Add support for configuring Traefik middleware such as StripPrefix #825

mhrlife opened this issue Dec 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mhrlife
Copy link

mhrlife commented Dec 6, 2024

What problem will this feature address?

Currently, when deploying applications with URL prefixes using Dokploy, there's no built-in option to configure Traefik middlewares like StripPrefix. This limitation requires manual modifications to the Traefik configuration after deployment. It makes it difficult to deploy applications that need URL prefix handling without additional manual steps.

Describe the solution you'd like

I would like Dokploy to provide the ability to configure Traefik middlewares through its deployment configurations. Specifically, adding support for the StripPrefix middleware would allow users to specify prefixes that Traefik should strip from incoming requests before forwarding them to backend services.

Describe alternatives you've considered

The alternative is to manually modify the Traefik configuration after deployment to include the necessary middleware. For example:

http:
  routers:
    my-app-router:
      rule: Host(`myapp.example.com`) && PathPrefix(`/chat`)
      service: my-app-service
      middlewares:
        - strip-chat-prefix
      entryPoints:
        - web

  middlewares:
    strip-chat-prefix:
      stripPrefix:
        prefixes:
          - "/chat"

However, this manual process is not ideal for automated deployments and can lead to inconsistencies across environments.

Additional context

No response

Will you send a PR to implement it?

No

@mhrlife mhrlife added the enhancement New feature or request label Dec 6, 2024
@bigtob
Copy link

bigtob commented Dec 9, 2024

I have similar issues with middleware definitions for ipAllowList and basicAuth. Any attempt to apply these to routers via Docker labels doesn't work - they appear to be completely ignored. What is strange is that I can define them (via Docker labels) just fine (such as they appear in the Traefik console).

...
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.example-wordpress-test.rule=Host(`somehost.mycompany.co.uk`)"
      - "traefik.http.routers.example-wordpress-test.entrypoints=websecure"
      - "traefik.http.services.example-wordpress-test.loadbalancer.server.port=80"
      - "traefik.http.routers.example-wordpress-test.middlewares=MYauth@file" # Ignored, not applied
...

@binaryYuki
Copy link
Contributor

Got the same issue. Hope we can have traefik middleware supports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants