Skip to content

Instantly share code, notes, and snippets.

@yuuahp
Created May 4, 2025 10:53
Show Gist options
  • Select an option

  • Save yuuahp/822e6389bf16279c0a211fa437fafc8a to your computer and use it in GitHub Desktop.

Select an option

Save yuuahp/822e6389bf16279c0a211fa437fafc8a to your computer and use it in GitHub Desktop.
Simple Immich + Nginx configuration with self-signed HTTPS access
name: immich
services:
nginx:
image: nginx:latest
container_name: reverse_proxy
ports:
- 3001:3001
- 3000:3000
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
depends_on:
- immich-server
# immich server and DBs...
events {}
http {
server {
listen 3001;
server_name myserver.invalid;
return 301 https://$host$request_uri;
}
server {
listen 3000 ssl; # host on 3000
server_name myserver.invalid;
ssl_certificate /etc/nginx/certs/myserver.invalid.crt;
ssl_certificate_key /etc/nginx/certs/myserver.invalid.key;
sendfile on;
client_max_body_size 0;
location / {
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://immich_server:2283;
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-Proto $scheme;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment