Created
February 29, 2024 10:31
-
-
Save lucahammer/f4a98a6eab0e3d87e4f2a0223949a63f to your computer and use it in GitHub Desktop.
Snipe IT docker compose behind NGINX Proxy with HTTPS
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: | |
snipeit: | |
image: snipe/snipe-it:latest | |
container_name: snipeit | |
ports: | |
- "44100:443" | |
volumes: | |
- ./storage/logs:/var/www/html/storage/logs | |
- ./ssl:/var/lib/snipeit/ssl #you need to put a snipeit-ssl.crt and snipeit-ssl.key therer (can be self-signed) | |
depends_on: | |
- mariadb | |
env_file: | |
- .env.docker | |
networks: | |
- snipeit-backend | |
- nginx | |
mariadb: | |
image: mariadb:10.6.4-focal | |
volumes: | |
- db:/var/lib/mysql | |
env_file: | |
- .env.docker | |
networks: | |
- snipeit-backend | |
ports: | |
- "3306:3306" | |
volumes: | |
db: {} | |
networks: | |
snipeit-backend: {} | |
toolnet: | |
name: nginx | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add "proxy_set_header X-Forwarded-Proto $scheme;" to the nginx proxy host config.
Make sure that you add/change the following vars in .env.docker:
APP_URL=https://your-domain.com #the 's' in 'https' is important
APP_TRUSTED_PROXIES="*" #ideally IP of proxy instead of *
COOKIE_DOMAIN=your-domain.com
SECURE_COOKIES=true