diff --git a/mastodon/docker-compose.yaml b/mastodon/docker-compose.yaml index b4fb1c2..2a3f2cf 100644 --- a/mastodon/docker-compose.yaml +++ b/mastodon/docker-compose.yaml @@ -7,7 +7,7 @@ services: networks: - internal_network healthcheck: - test: ['CMD', 'pg_isready', '-U', "mastodon"] + test: ['CMD', 'pg_isready', '-U', "mastodon", "-d", "mastodon_production"] volumes: - ./database:/var/lib/postgresql/data environment: diff --git a/mastodon/env.production b/mastodon/env.production index af94eff..dcb6307 100644 --- a/mastodon/env.production +++ b/mastodon/env.production @@ -14,7 +14,9 @@ # ---------- # This identifies your server and cannot be changed safely later # ---------- -LOCAL_DOMAIN=spacestation +LOCAL_DOMAIN=social.example.com +#WEB_DOMAIN=social.example.com +TRUSTED_PROXY_IP=10.1.0.142 # Redis # ----- diff --git a/nginx/data/nginx/templates/social.conf.template b/nginx/data/nginx/templates/social.conf.template new file mode 100644 index 0000000..d8aa47d --- /dev/null +++ b/nginx/data/nginx/templates/social.conf.template @@ -0,0 +1,27 @@ +server { + listen 80; + server_name social.${DOMAIN_NAME}; + location / { + return 301 https://$host$request_uri; + } +} + +server { + server_name social.${DOMAIN_NAME}; + client_max_body_size 128m; + + location / { + proxy_pass http://spacestation:6001; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto https; + } + + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +