-
Notifications
You must be signed in to change notification settings - Fork 297
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
[Question] Example for independent nginx deployment #1455
Comments
Okay after some tinkering, below is my solution. My shaarli and nginx containers are on a shared network, that's why I can use the server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name foo.example.com; # populate this
include foo.conf; # populate this, if necessary
access_log /var/log/nginx/shaarli-access.log;
error_log /var/log/nginx/shaarli-error.log error;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
location / {
proxy_pass http://shaarli:80;
}
} This should be added to the docs. |
The nginx reverseproxy configuration should be fixed in #1389 - https://shaarli.readthedocs.io/en/doc-rework-setup/Reverse-proxy/. @lonix1 Is something else missing?
The shaarli image is just that, Alpine + nginx + php-fpm https://github.com/shaarli/Shaarli/blob/master/Dockerfile |
Hey @nodiscc / @ArthurHoaro, sorry for late response only upgraded today to latest version.
No what I meant was - and still applicable - is there an image without nginx? It's unnecessary if one is already using a reverse proxy. Usual setup:
Shaarli docker image:
Although nginx is fast, running one after the other is incredibly wasteful. It also creates config headaches (as I showed above). A workaround is to create a custom A better solution is an image that doesn't bundle nginx. e.g. Since this issue is still relevant, maybe someone could reopen? |
I think I see what you're getting at.
|
@virtadpt That's a very detailed explanation of the issue... thanks and yes! In my (and most) setups, different containers are used for different services. Example:
All of them are on the same network as nginx, which serves them all. Of course this is just one network design, but the most common. Bundling nginx into the container (as done by shaarli) is really helpful to new docker users - so I don't think it's a bad thing. But there should also be a "normal" shaarli image that does not include nginx. To make this work:
I hope someone reopens this, and considers it! Thanks!! |
I agree with everything that has been said. Embedding nginx is usefull if you want the Docker image to work out of the box, but in a lot of cases it can be an unnecessary layer.
I would rather tag the new image with something like EDIT: moving back the milestone to 1.0.0 as it makes sense to me to have that possibility for that version. |
I already run dockerised nginx. I want to run dockerised shaarli, and proxy requests from nginx to shaarli.
All examples I've seen are for nginx running inside the shaarli container (which as an aside, is non-standard and was confusing to debug... that said I suppose it's convenient for beginners).
So:
fastcgi_pass
, whereas in the normal setup where the proxy is independent, we would useproxy_pass
.Any advice appreciated!
The text was updated successfully, but these errors were encountered: