Swag config with immich in a docker container.

Good morning everyone, First off, I'm new here but I'm really excited to use immich and report anything unexpected I encounter. I'm an unRAID user and installed immich from the apps center within unRAID. I'm making use of a redis and postgreSQL database outside of the container. (see screenshot) Within this screenshot the port mappings are also apparent. I had to change the default mapping of 8080 (still the case within my docker network) to something else (8585, in my case) to not conflict with other containers within the network. I'm trying to expose my container making use of my SWAG reverse proxy, which is also present within the same docker network. I'm changing the default app name from immich to image. I will now provide both my docker compose file for the container and my SWAG reverse proxy setup. How does this setup look? Unfortunately, SWAG is currently complaining about something, but I have yet to figure it out. I'm thinking that it has to do with the proxy pass part being incorrect. From what I've seen online people were using different ports, I only seem to have 8080 mapped; people seem to name immich-server and immich-web. I could use some help here :)
No description
15 Replies
Quafley
QuafleyOP3y ago
gathering more info
Quafley
QuafleyOP3y ago
Now that I'm looking at my docker compose, 1 thing I know is that I've got the port mapping completely wrong. I can confirm that my swag container etc. is correctly configured. I changed the location /api part:
set $upstream_app immich_server;
set $upstream_port 3001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
set $upstream_app immich_server;
set $upstream_port 3001;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
However, it still doesn't seem to work. So, if anyone could provide some assistance? Thanks in advance. :) (Please tag me)
Quafley
QuafleyOP3y ago
When trying to access the site with the above config it reports a 502 error. WHen I switch immich_app to immich and port from 3000 to 8080, it reports a 400 error. Bit stuck. yeah I can't seem to figure it out. It's either a 400 bad request or 502
Quafley
QuafleyOP3y ago
or this when switching both api and location to 3001 and immich
No description
MicheI
MicheI3y ago
You're using a non-standard single container setup, so some things might be different. But usually port 3001 is the server/api and port 3000 is the web container. The included proxy container is running on port 8080 and you should be able to just point your own proxy to port 8080
Quafley
QuafleyOP3y ago
Hm I wonder why it won't work then, not doing anything special here
MicheI
MicheI3y ago
Did you fix the port mapping in the compose file? What happens when you go to http://192.168.1.121:8585?
Quafley
QuafleyOP3y ago
oh that works without issue But since it's all in the same docker network I can get away by saying http://immich:8080 or at least I should be able to When I set up port 8080, it throws a bad request message, which I have not encountered before with other apps. when changing to 3001 I get the message as shown in the screenshot I know it works since I'm able to ping immich:8080 from my swag container well, I suppose any port would work but I can ping immich
MicheI
MicheI3y ago
And then pointing your swag nginx proxy to immich doesn't work? What if you try a basic config like this
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name image.*;

include /config/nginx/ssl.conf;

location / {
proxy_pass http://immich:8080;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name image.*;

include /config/nginx/ssl.conf;

location / {
proxy_pass http://immich:8080;
}
}
Quafley
QuafleyOP3y ago
that works hm that is odd ah okay I think I found why it is giving me a 400 error It seems to be linked to the proxy.conf file within swag
Quafley
QuafleyOP3y ago
No description
Quafley
QuafleyOP3y ago
Alright I made some changes and got it working, it seems that the following settings were already provided by proxy.conf and were exactly the same:
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;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
After commenting them out and enabling proxy.conf again it works without issue it seems. This problem has been resolved.

Did you find this page helpful?