add auth & off configs

This commit is contained in:
vchikalkin 2023-11-01 14:21:01 +03:00
parent 644bbfa13b
commit b559225f5c
5 changed files with 69 additions and 2 deletions

2
.env
View File

@ -6,4 +6,4 @@ TRAEFIK_ENTRYPOINTS=web-secure
WEB_HOST=
APPLICATION=
AUTH_MODE=ldap
# AUTH_MODE=standard
# AUTH_MODE=account

44
config/nginx.off.conf Normal file
View File

@ -0,0 +1,44 @@
upstream app {
server $APPLICATION;
}
include /etc/nginx/include/upstream.conf;
server {
listen 80;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 1;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_disable "msie6";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Original-Remote-Addr $remote_addr;
proxy_set_header X-Original-Host $host;
location / {
proxy_pass http://app;
}
location = /health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 'UP';
}
include /etc/nginx/include/location.conf;
}

View File

@ -10,7 +10,7 @@ services:
- APPLICATION=${APPLICATION}
- AUTH_MODE=${AUTH_MODE}
volumes:
- ./config/nginx.conf:/etc/nginx/templates/default.conf.template
- ./config/nginx.auth.conf:/etc/nginx/templates/default.conf.template
- ./config/include:/etc/nginx/include
restart: always
networks:

23
docker-compose.off.yml Normal file
View File

@ -0,0 +1,23 @@
version: '3'
services:
server:
extends:
file: docker-compose.traefik.yml
service: server
image: nginx:alpine
environment:
- APPLICATION=${APPLICATION}
volumes:
- ./config/nginx.off.conf:/etc/nginx/templates/default.conf.template
- ./config/include:/etc/nginx/include
restart: always
networks:
- app_network
networks:
app_network:
external: true
name: ${NETWORK_NAME}
web:
external: true