Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brand new site can't see images #176

Closed
mlapaglia opened this issue Jan 7, 2024 · 15 comments
Closed

brand new site can't see images #176

mlapaglia opened this issue Jan 7, 2024 · 15 comments

Comments

@mlapaglia
Copy link

running docker run -p 80 lycheeorg/lychee creates a site that images can't be viewed after uploading them, looks like it's trying to get images from localhost
image
is there any documentation for how to get it up and running successfully?

@MikeTheTux
Copy link

You need to set APP_URL env variable to the IP Address

@mlapaglia
Copy link
Author

what port is https on? i tried using 443 but it doesn't respond.
image

@ildyria
Copy link
Member

ildyria commented Jan 7, 2024

it does respond, but it all the queries you are making afterwards are blocked by the CSP. That is because you are trying to fetch http on the data.
You need to set you APP_URL with the https prefix.

@mlapaglia
Copy link
Author

mlapaglia commented Jan 7, 2024

ok switched it to the 443, the site isn't responding to 443 it still works on 80 though

docker run -d
  -e 'APP_URL'='https://192.168.1.164:4880/'
  -p '4879:80/tcp'
  -p '4880:443/tcp'

image

image

@ildyria
Copy link
Member

ildyria commented Jan 7, 2024

docker run -d
  -e 'APP_URL'='http://192.168.1.164'
  -p '4879:80/tcp'

@ildyria
Copy link
Member

ildyria commented Jan 7, 2024

you can't use https without setting a certificate or using a reverse proxy.
Our docker image only opens port 80.

If you use a reverse proxy which takes care of https (and the certificate) and redirect then traffic to 80, then you will need to set your APP_URL to https.

@MikeTheTux
Copy link

You can have a look at #175

@mlapaglia
Copy link
Author

mlapaglia commented Jan 8, 2024

Ok here is my reverse proxy settings:
image

APP_URL is now https://MYDOMAIN.com/

it's still requesting http urls though
image

when i try to access the site locally again it tries to use the https MYDOMAIN
image

You can have a look at #175

this just seems like a bunch of workarounds? is there any documentation about using a reverse proxy? i've had it running for years but v5 has made it stop working.

@MikeTheTux
Copy link

MikeTheTux commented Jan 8, 2024

this just seems like a bunch of workarounds?

I'm also just a user, who struggled with similar problems. That's the reason why I created #175.

Did you modify /etc/nginx/nginx.conf within the container (fastcgi_param HTTPS on;)? I guess this is the missing piece.

@ildyria
Copy link
Member

ildyria commented Jan 8, 2024

Did you modify /etc/nginx/nginx.conf within the container (fastcgi_param HTTPS on;)? I guess this is the missing piece.

That should not be necessary as long as the reverse proxy is forwarding https headers.

I'll try to improve the description for Apache, but I can't really do much for the nginx one as I don't have knowledge there.
Furthermore, I strongly suggest to use docker compose rather than docker from cli.

@mlapaglia
Copy link
Author

I can lend a hand if you can show me how to record the headers being forwarded. is there something special about lychee that makes it work different than many other docker containers i forward the same way to? could the APP_URL be omitted and the site serve up content to whatever requests it?

@ildyria
Copy link
Member

ildyria commented Jan 8, 2024

@jotka
Copy link

jotka commented Jan 9, 2024

same for me.
Something is wrong with this APP_URL.

after starting with

-e APP_URL=192.168.1.4

the image URL is rendered as:

http://192.168.1.4:13380/gallery/U0Cz5MyvYH4QE9rzxIl48WS_/192.168.1.4/uploads/medium2x/dd/3e/a8aef076afeda630245b0b0e1b18.jpg

which renders 404 NotFoundHttpException

172.17.0.1 - - [09/Jan/2024:18:08:57 +0100] "GET /192.168.1.4:13380/uploads/medium/dd/3e/a8aef076afeda630245b0b0e1b18.jpg HTTP/1.1" 404 48505 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15" "-"
172.17.0.1 - - [09/Jan/2024:18:08:57 +0100] "GET /192.168.1.4:13380/uploads/small2x/dd/3e/a8aef076afeda630245b0b0e1b18.jpg HTTP/1.1" 404 48492 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15" "-"
172.17.0.1 - - [09/Jan/2024:18:08:57 +0100] "GET /192.168.1.4:13380/uploads/small2x/18/43/cd5f57bed44befc5b50bfa63fb9a.jpg HTTP/1.1" 404 48495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15" "-"

@jotka
Copy link

jotka commented Jan 9, 2024

ok, adding http:// helps:

-e APP_URL=http://192.168.1.4:13380 \

but do we need this env after all? what about if I'm serving the app on multiple different domains?

@ildyria
Copy link
Member

ildyria commented Jan 19, 2024

Should be resolved with latest builds.

@ildyria ildyria closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants