# notes when adding to conf.d
After adding a new .conf file, replicas must be scaled to 0 then to 1 for change to take effect
+
+# deploying
+```
+docker stack deploy -c <(docker-compose config) proxy
+```
--- /dev/null
+server {
+ listen 443 ssl;
+ server_name git.purplebirdman.com;
+ ssl_certificate /etc/letsencrypt/live/purplebirdman.com-0001/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/purplebirdman.com-0001/privkey.pem;
+
+ location / {
+ proxy_pass http://gitweb_web;
+ proxy_set_header Host $host;
+ }
+}
-# requires variable config loading, such as:
-# docker stack deploy -c <(docker-compose config) proxy
-#
-# also needs an .env file with some variables!
-
version: '3'
networks:
proxy:
external: true
services:
web:
- image: nginx:1.17
+ image: nginx:1.27-alpine
volumes:
- /etc/letsencrypt/:/etc/letsencrypt/
- - ./nginx.conf:/etc/nginx/nginx.conf
- ./conf.d/:/etc/nginx/conf.d/
environment:
- NGINX_HOST=purplebirdman.com
+++ /dev/null
-user nginx;
-worker_processes 1;
-
-error_log /var/log/nginx/error.log warn;
-pid /var/run/nginx.pid;
-
-
-events {
- worker_connections 1024;
-}
-
-
-http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /var/log/nginx/access.log main;
-
- sendfile on;
- #tcp_nopush on;
-
- keepalive_timeout 65;
-
- #gzip on;
-
- include /etc/nginx/conf.d/*.conf;
-}
+++ /dev/null
-#!/bin/bash
-# source: https://eff-certbot.readthedocs.io/en/latest/install.html#alternative-1-docker
-
-docker run -it --rm --name certbot \
- -v "/etc/letsencrypt:/etc/letsencrypt" \
- -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
- -v "$HOME/.aws:/aws" \
- -e "AWS_CONFIG_FILE=/aws/config" \
- -e "AWS_SHARED_CREDENTIALS_FILE=/aws/credentials" \
- -p 80:80 \
- certbot/dns-route53 certonly
+++ /dev/null
-#!/bin/bash
-docker stack deploy -c <(docker-compose config) proxy