Traefik

How to serve static content with Nginx and Django Gunicorn when using Traefik

倖福魔咒の 提交于 2019-12-05 01:09:33
问题 I have a web application (Django based) that is utilising multiple containers: Web Application (Django + Gunicorn) Traefik (acting as the reverse proxy and SSL termination) Database which is used with the Web application Redis which is used with the Web application According to some of the documentation I have read, I should be serving my static content using something like NGINX. But I don't have any idea on how I would do that. Would I install NGINX on my Web Application container or as a

Howto rewrite paths with traefik when using path prefix rules?

不想你离开。 提交于 2019-12-04 06:55:46
My traefik config for wordpress contains the following docker-labels: - "traefik.backend=wordpress" - "traefik.docker.network=web" - "traefik.frontend.rule=Host:MyHostName.net;PathPrefix:/blog" - "traefik.enable=true" - "traefik.port=80" Now requesting the url " https://MyHostName/blog " seems to reach the service which seems to return a redirect to " https://MyHostName/wp-admin ...". Any idea how to solve this? THX in advance! Info: I cannot use subdomains... UPDATE 0 First thing to do should be adding the Filter "PathPrefixStrip:/blog" to remove the "/blog" prefix when forwarding the request

Routing paths with Traefik

淺唱寂寞╮ 提交于 2019-12-04 00:52:02
问题 Currently I'm trying set up a loadbalancer/reverse proxy with Traefik for some docker containers. I'm having trouble with configuring Treafik to make my apps available using a some prefix paths. I'm able to get a basic Traefik configuration running using Docker and Docker compose, based on this example. The problem is that I'm able to get the 'whoamI' container to be reachable at a path, but not my app and other containers. For example, I've created a docker-compose file (see below) to start

Path based routing issues Traefik as Ingress Controller

纵饮孤独 提交于 2019-12-03 20:27:58
I'm running through what looks like a configuration issue! I am using traefik as ingress controller within kubernetes and I have an ingress to route some URLs to route some frontends to various backends. Let's say I have something like this: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test annotations: kubernetes.io/ingress.class: traefik traefik.frontend.rule.type: ReplacePathRegex spec: rules: - host: foo.io http: paths: - path: /api/authservice/(.*) /$1 backend: serviceName: auth servicePort: 8901 - path: /api/svcXXX/v1/files/cover/(.*) /v1/files/cover/$1 backend:

HTTPS-Redirect with Traefik behind Aws Loadbalancer

那年仲夏 提交于 2019-12-02 01:26:11
I'm trying to redirect all incoming Traefik from http to https, for a web application which gets served out of a docker container with a custom port. If I build this docker compose file, and scale the application everything works as expected. I'm able to request http and https of the application, but I try to accomplish that only https get served and http gets redirected to https. Since I use a Docker-Compose file, I don't have a Traefik.toml, and try to accomplish this without one. Docker Compose: traefik: image: traefik:latest command: - "--api" - "--docker" - "--docker.domain=example.com" -

Global configuration of security in Traefik for Docker

ぃ、小莉子 提交于 2019-12-01 13:12:15
Since version 1.5 Traefik give option to configure security for each service. These options are for available here https://docs.traefik.io/configuration/backends/docker/#security-headers and must be set in the label section of each service defined in the docker-compose file. I wonder how can I add these options in a global manner? Stoinov So just for posterity, here is how to do it using a template file: Get the template docker.tmpl from source and make sure it's for your exact version. The easiest way - just click on the build number in the top right of the UI and browse to /template folder.

只需5分钟!即可在mac上运行k3s

China☆狼群 提交于 2019-12-01 12:11:28
k3s是由Rancher Labs于今年年初发布的一款开源、极轻量的Kubernetes发行版,完美适用于在资源有限的环境中运行Kubernetes。由于其轻量的特性,因此它是开发人员在笔记本上进行探索和试验的理想选择。但是原生的k3s比较适合在Linux上使用,我们怎么在Mac上运行它呢? 这时候我们需要一个工具——Multipass。它提供命令行界面,允许用户协调Ubuntu Linux虚拟机的创建,管理和维护,以简化应用程序的开发,并且可以在mac上使用。 首先我们使用brew(一个软件包管理工具)安装Multipass。 brew search multipass brew cask install multipass 现在使用Multipass来创建一个VM:需要1GB内存和5GB磁盘 multipass launch --name k3s --mem 1G --disk 5G Launched: k3s 等待VM创建,然后为VM启动一个shell multipass shell k3s 接着运行命令 curl -sfL https://get.k3s.io | sh – 来安装k3s [INFO] Finding latest release [INFO] Using v0.2.0 as release [INFO] Downloading hash https:/

Is there an equivalent to ReverseProxyPass for Apache in Traefik?

依然范特西╮ 提交于 2019-12-01 06:43:24
I have setup Traefik to work in Docker Swarm mode. I have deployed Portainer into the cluster with the following command: docker service create \ \ --label "traefik.port=9000" \ --label "traefik.docker.network =traefik-net" \ --label "traefik.frontend.rule=Host:`hostname -f`;PathPrefixStrip:/portainer" \ --label="traefik.backend=portainer" \ \ --network traefik-net \ --constraint "node.role == manager" \ -p 9000:9000 \ --mount "type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock" \ --name portainer \ portainer/portainer As can be seen I have configured Traefik, through the use of

Routing paths with Traefik

醉酒当歌 提交于 2019-12-01 03:56:41
Currently I'm trying set up a loadbalancer/reverse proxy with Traefik for some docker containers. I'm having trouble with configuring Treafik to make my apps available using a some prefix paths. I'm able to get a basic Traefik configuration running using Docker and Docker compose, based on this example . The problem is that I'm able to get the 'whoamI' container to be reachable at a path, but not my app and other containers. For example, I've created a docker-compose file (see below) to start the whoamI container, and five Portainer containers (so people can recreate the scenario). I would

Traefik-v2.x快速入门

£可爱£侵袭症+ 提交于 2019-11-30 15:07:17
Traefik v2.0 快速入门 traefik官方文档 注意:Traefikv2.0之后的版本在修改了很多bug之后也增加了新的特性,比如增加了TCP的支持,并且更换了新的WEB UI界面 使用 docker-compose 来快速启动traefki实例. # 查看编辑好的docker-compose配置文件 $ cat traefik-v2.0.yaml version: '3' services: reverse-proxy: image: traefik:2.0.1 # Enables the web UI and tells Traefik to listen to docker # 启用webUI 并告诉Traefile去监听docker的容器实例 command: --api.insecure=true --providers.docker ports: # traefik暴露的http端口 - "80:80" # webUI暴露的端口(必须制定--api.insecure=true才可以访问) - "8080:8080" volumes: # 指定docker的sock文件来让traefik获取docker的事件,从而实现动态负载均衡 - /var/run/docker.sock:/var/run/docker.sock # 使用docker