From 1372ddb951c6d977385dd4eec318df68e32bac07 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Fri, 5 Aug 2022 14:03:30 +0200 Subject: [PATCH] Add volumes --- .gitignore | 0 .rsyncignore | 0 volumes/nginx/conf.d/advlabdb.conf | 12 +++++++++ volumes/nginx/conf.d/xueyue-li.art.conf | 11 ++++++++ volumes/traefik/dynamic.yml | 32 ++++++++++++++++++++++ volumes/traefik/traefik.yml | 36 +++++++++++++++++++++++++ 6 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 .rsyncignore create mode 100644 volumes/nginx/conf.d/advlabdb.conf create mode 100644 volumes/nginx/conf.d/xueyue-li.art.conf create mode 100644 volumes/traefik/dynamic.yml create mode 100644 volumes/traefik/traefik.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.rsyncignore b/.rsyncignore new file mode 100644 index 0000000..e69de29 diff --git a/volumes/nginx/conf.d/advlabdb.conf b/volumes/nginx/conf.d/advlabdb.conf new file mode 100644 index 0000000..afa98d5 --- /dev/null +++ b/volumes/nginx/conf.d/advlabdb.conf @@ -0,0 +1,12 @@ +server { + listen 80; + server_name advlabdb.mo8it.xyz; + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_pass http://advlabdb; + } +} diff --git a/volumes/nginx/conf.d/xueyue-li.art.conf b/volumes/nginx/conf.d/xueyue-li.art.conf new file mode 100644 index 0000000..a3b0674 --- /dev/null +++ b/volumes/nginx/conf.d/xueyue-li.art.conf @@ -0,0 +1,11 @@ +server { + listen 80; + server_name xueyue-li.art www.xueyue-li.art; + + location / { + root /volumes/sites/xueyue-li.art; + index index.html; + } + + error_page 404 /404.html; +} diff --git a/volumes/traefik/dynamic.yml b/volumes/traefik/dynamic.yml new file mode 100644 index 0000000..cdc2dd2 --- /dev/null +++ b/volumes/traefik/dynamic.yml @@ -0,0 +1,32 @@ +--- +http: + routers: + to_dudu_hugo: + rule: Host(`xueyue-li.art`) || Host(`www.xueyue-li.art`) + service: dudu_hugo + tls: + certResolver: le + to_advlabdb: + rule: Host(`advlabdb.mo8it.xyz`) + service: advlabdb + tls: + certResolver: le + to_gitea: + rule: Host(`git.mo8it.xyz`) + service: gitea + tls: + certResolver: le + + services: + dudu_hugo: + loadBalancer: + servers: + - url: http://nginx + advlabdb: + loadBalancer: + servers: + - url: http://nginx + gitea: + loadBalancer: + servers: + - url: http://gitea:3000 diff --git a/volumes/traefik/traefik.yml b/volumes/traefik/traefik.yml new file mode 100644 index 0000000..b76e5fb --- /dev/null +++ b/volumes/traefik/traefik.yml @@ -0,0 +1,36 @@ +--- +global: + checkNewVersion: false + sendAnonymousUsage: true + +log: + filePath: /volumes/logs/traefik.log + level: ERROR + +entryPoints: + web: + address: :80 + http: + redirections: + entryPoint: + to: websecure + scheme: https + + websecure: + address: :443 + +certificatesResolvers: + le: + acme: + email: mo8it@proton.me + storage: /volumes/certs/acme.json + # caServer: https://acme-staging-v02.api.letsencrypt.org/directory + tlsChallenge: {} + +accessLog: + filePath: /volumes/logs/access.log + bufferingSize: 100 + +providers: + file: + filename: /etc/traefik/dynamic.yml