mastodon: nginx routing works

single-dockerfile
Ubuntu 3 years ago
parent 28aa60d712
commit 45cae54638
  1. 2
      mastodon/docker-compose.yaml
  2. 4
      mastodon/env.production
  3. 27
      nginx/data/nginx/templates/social.conf.template

@ -7,7 +7,7 @@ services:
networks: networks:
- internal_network - internal_network
healthcheck: healthcheck:
test: ['CMD', 'pg_isready', '-U', "mastodon"] test: ['CMD', 'pg_isready', '-U', "mastodon", "-d", "mastodon_production"]
volumes: volumes:
- ./database:/var/lib/postgresql/data - ./database:/var/lib/postgresql/data
environment: environment:

@ -14,7 +14,9 @@
# ---------- # ----------
# This identifies your server and cannot be changed safely later # 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 # Redis
# ----- # -----

@ -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;
}
Loading…
Cancel
Save