-
-
Save avoiney/5453ffdce2b15bd0f331071b01eb5a8f to your computer and use it in GitHub Desktop.
Directus under non root path with nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIRECTUS_KEY=<...> | |
DIRECTUS_SECRET=<...> | |
DIRECTUS_DB_DATABASE=<...> | |
DIRECTUS_DB_USER=<...> | |
DIRECTUS_DB_PASSWORD=<...> | |
DIRECTUS_CACHE_ENABLED=true | |
DIRECTUS_CACHE_STORE=redis | |
DIRECTUS_ADMIN_EMAIL=<...> | |
DIRECTUS_ADMIN_PASSWORD=<...> | |
DIRECTUS_PUBLIC_URL=https://<server_name>/directus/ # server_name is the one used in nginx. Note the slash at the end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 0.0.0.0:443 ssl; | |
server_name <server_name>; | |
ssl on; | |
ssl_certificate <ssl_certificate_absolute_path>; | |
ssl_certificate_key <ssl_certificate_key_absolute_path>; | |
ssl_prefer_server_ciphers On; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS; | |
location /directus/ { // note the slash here | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $server_name; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_buffering off; | |
proxy_pass http://127.0.0.1:8055/; // note the slash here too | |
proxy_redirect off; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
directus_database: | |
image: postgres:12 | |
volumes: | |
- directus_db:/var/lib/postgresql/data | |
networks: | |
- directus | |
environment: | |
POSTGRES_USER: "${DIRECTUS_DB_USER}" | |
POSTGRES_PASSWORD: "${DIRECTUS_DB_PASSWORD}" | |
POSTGRES_DB: "${DIRECTUS_DB_DATABASE}" | |
directus_cache: | |
image: redis:6 | |
networks: | |
- directus | |
directus_server: | |
image: directus/directus:9.0.0-rc.86 | |
ports: | |
- 8055:8055 | |
volumes: | |
- directus_uploads:/directus/uploads | |
networks: | |
- directus | |
depends_on: | |
- directus_cache | |
- directus_database | |
environment: | |
KEY: "${DIRECTUS_KEY}" | |
SECRET: "${DIRECTUS_SECRET}" | |
DB_CLIENT: "pg" | |
DB_HOST: "directus_database" | |
DB_PORT: 5432 | |
DB_DATABASE: "${DIRECTUS_DB_DATABASE}" | |
DB_USER: "${DIRECTUS_DB_USER}" | |
DB_PASSWORD: "${DIRECTUS_DB_PASSWORD}" | |
CACHE_ENABLED: "${DIRECTUS_CACHE_ENABLED}" | |
CACHE_STORE: "${DIRECTUS_CACHE_STORE}" | |
CACHE_REDIS: "redis://directus_cache:6379" | |
ADMIN_EMAIL: "${DIRECTUS_ADMIN_EMAIL}" | |
ADMIN_PASSWORD: "${DIRECTUS_ADMIN_PASSWORD}" | |
PUBLIC_URL: "${DIRECTUS_PUBLIC_URL}" | |
networks: | |
directus: | |
volumes: | |
directus_db: | |
directus_uploads: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment