YOURLS / containers

📦 Container Images for YOURLS
https://yourls.org
MIT License
138 stars 42 forks source link

`fpm` image does not serve static files #243

Closed eta-orionis closed 1 year ago

eta-orionis commented 1 year ago

Code of Conduct

Submission validity

Self troubleshooting

Version

1.9.2

Description

Running latest yourls:fpm-alpine image with an nginx reverse proxy in front of it. jQuery and other static assets are "404 not found" by nginx -- which is to be expected, since they are not on the nginx container and the nginx container cannot access files on another container (yourls). As a result, the interface simply does not work.

Expectation

Reproduction steps

docker-compose with three containers

Configure yourls and nginx as per documentation at https://yourls.org/docs/guide/server-configuration#the-basic-nginx-server-configuration Try accessing any of the static files, e.g. /js/jquery-3.5.1.min.js?v=1.9.2

Context

The documentation does not provide any way or example to use the fpm image together with a reverse proxy. Such an example would be appreciated. If this is not possible at all, then the fpm image is of little use and could be deprecated/removed.

LeoColomb commented 1 year ago

Thanks for opening this issue @eta-orionis. That said, I'm not sure to follow your point. You are indeed free to use/build the infrastructure you want, and FPM images are an option that could match architecture needs. But YOURLS documentation is focused on how to use YOURLS software, not really on how to design a complete service infra. Indeed, there is literally an infinite of possibilities.

Now in your specific case, if I understood correctly, you are using Nginx as a reverse proxy to handle FastCGI forwarding, which is great. That said, you are referring to the Nginx server configuration template, which is a different usage of Nginx. If you have used this configuration, static files won't be served, indeed.

I'd suggest two options: