diff --git a/nginxs/docs/.env.example b/nginxs/docs/.env.example new file mode 100644 index 0000000..98fdfde --- /dev/null +++ b/nginxs/docs/.env.example @@ -0,0 +1,2 @@ +DATA_PATH= +CN= diff --git a/nginxs/docs/Dockerfile b/nginxs/docs/Dockerfile new file mode 100644 index 0000000..a21c6ec --- /dev/null +++ b/nginxs/docs/Dockerfile @@ -0,0 +1,6 @@ +from nginx:1.21.4-alpine + +RUN sed -i "/http {/a\ \ \ \ server_tokens off;" /etc/nginx/nginx.conf \ + && sed -i "s/remote_addr/http_x_forwarded_for/g" /etc/nginx/nginx.conf + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginxs/docs/docker-compose.yml b/nginxs/docs/docker-compose.yml new file mode 100644 index 0000000..d235c66 --- /dev/null +++ b/nginxs/docs/docker-compose.yml @@ -0,0 +1,30 @@ +version: "3.8" + +services: + web: + build: . + image: my_nginx:1.21.4 + networks: + - proxy + expose: + - "80" + restart: unless-stopped + volumes: + - ${DATA_PATH}/html/:/usr/share/nginx/html:ro + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.docs-redirect-websecure.redirectscheme.scheme=https" + - "traefik.http.routers.docs-http.middlewares=docs-redirect-websecure" + - "traefik.http.routers.docs-http.rule=Host(`${CN}`)" + - "traefik.http.routers.docs-http.entrypoints=web" + - "traefik.http.routers.docs-https.rule=Host(`${CN}`)" + - "traefik.http.routers.docs-https.entrypoints=websecure" + - "traefik.http.routers.docs-https.tls=true" + - "traefik.http.routers.docs-https.tls.certresolver=myhttpchallenge" + - "co.elastic.logs/module=nginx" + +networks: + proxy: + external: true