Revert "proxying with nginx"

This reverts commit 19180b6800.

Maybe not needed after all!
This commit is contained in:
decentral1se 2021-12-10 09:32:30 +01:00
parent 19180b6800
commit 1c9c8ee7b0
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
3 changed files with 14 additions and 91 deletions

View File

@ -1,3 +1,2 @@
export CONFIG_WRITEFREELY_VERSION=v1
export CONFIG_ENTRYPOINT_VERSION=v1
export NGINX_CONFIG_VERSION=v1

View File

@ -2,32 +2,6 @@
version: "3.8"
services:
web:
image: nginx:1.20.0
networks:
- proxy
- internal
environment:
- DOMAIN
- STACK_NAME
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+latest"
app:
image: "writeas/writefreely:latest"
environment:
@ -52,6 +26,20 @@ services:
networks:
- internal
- proxy
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+latest"
db:
image: "mariadb:10.7"
@ -90,7 +78,3 @@ configs:
name: ${STACK_NAME}_config_${CONFIG_WRITEFREELY_VERSION}
file: config.ini.tmpl
template_driver: golang
nginx_config:
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
file: nginx.conf.tmpl
template_driver: golang

View File

@ -1,60 +0,0 @@
user www-data;
events {
worker_connections 768;
}
http {
upstream backend {
server {{ env "STACK_NAME" }}_app:8080;
}
include /etc/nginx/mime.types;
server {
listen 80;
listen [::]:80;
server_name example.com;
gzip on;
gzip_types
application/javascript
application/x-javascript
application/json
application/rss+xml
application/xml
image/svg+xml
image/x-icon
application/vnd.ms-fontobject
application/font-sfnt
text/css
text/plain;
gzip_min_length 256;
gzip_comp_level 5;
gzip_http_version 1.1;
gzip_vary on;
location ~ ^/.well-known/(webfinger|nodeinfo|host-meta) {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://backend;
proxy_redirect off;
}
location ~ ^/(css|img|js|fonts)/ {
root /var/www/example.com/static;
# Optionally cache these files in the browser:
# expires 12M;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://backend;
proxy_redirect off;
}
}
}