Skip to content

Instantly share code, notes, and snippets.

@lucahammer
Created February 29, 2024 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucahammer/f4a98a6eab0e3d87e4f2a0223949a63f to your computer and use it in GitHub Desktop.
Save lucahammer/f4a98a6eab0e3d87e4f2a0223949a63f to your computer and use it in GitHub Desktop.
Snipe IT docker compose behind NGINX Proxy with HTTPS
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
@lucahammer
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment