Help with nginx configuration
Hi
In my setup I have a server on public IP on Wireguard, and my Immich server is running in docker on the Wireguard client
Through Wireguard the Immich is perfectly accessible
However when I connect through my domain, I have "Server Offline - Uknown" in bottom left corner and a bunch of errors with websockets in the console, so I reckon my nginx configuration is bad, even though I copied it
Can you please help?
Thank you very much
In my setup I have a server on public IP on Wireguard, and my Immich server is running in docker on the Wireguard client
Through Wireguard the Immich is perfectly accessible
However when I connect through my domain, I have "Server Offline - Uknown" in bottom left corner and a bunch of errors with websockets in the console, so I reckon my nginx configuration is bad, even though I copied it
Can you please help?
Thank you very much
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
# Blocking requests not coming from the domains
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name _;
# SSL configuration for default server block
ssl_certificate /etc/letsencrypt/live/st-kan-selfhost.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/st-kan-selfhost.dev/privkey.pem;
# Deny all requests to unknown server_name over HTTPS
return 403;
}
...
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Domain
server_name im.mydomain;
# SSL keys
ssl_certificate /etc/letsencrypt/live/mydomain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain/privkey.pem;
# allow large file uploads
client_max_body_size 50000M;
# Set headers
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;
# enable websockets: http://nginx.org/en/docs/http/websocket.html
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# set timeout
proxy_read_timeout 600s;
proxy_send_timeout 600s;
send_timeout 600s;
location / {
proxy_pass http://wireguard-ip:2283;
}
}