-
Notifications
You must be signed in to change notification settings - Fork 186
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
latest image causes bad request #91
Comments
I cannot reproduce the issue. |
I have the same problem and trying to solve this. I configured it to use always HTTPS for the outside so if i open the page in browser it will always be https. But internaly he delegates maybe with HTTP and i think this causes with HTTP/2.0 some problems - i am trying to find a way to solve this out.. /EDIT |
same problem here with the same configuration as falkzilm (seafile behind nginx-proxy) |
Have you checked the logs? |
I've checked both directories and no trace of the problem. So far my solution is to comment "proxy_set_header X-Forwarded-Proto $scheme;" out in /templates/seafile.nginx.conf.template |
So the issue is obvious. Your proxy sets |
@shoeper The issue may be obvious, but not the proper solution. It appears this image doesn't give any control over the internal nginx configuration and doesn't account for the most common setup which is people running jwilder/nginx-proxy. |
I am having the same issue, same setup. @yopbot's workaround fixes the issue for me. I'm happy to attempt a PR if we know what the fix should be. |
+1 |
it is still an issue |
Also the bad request says "Contradictory scheme headers" (not handlers, at least for me, for people googling the issue). In general the docker image leaves much to be desired, if anyone has an alternative option, I'd appreciate a pointer. |
I use sunx/seafile with SQLite and an external nginx proxy. That works quite OK. |
Still no solution to this? Perhaps the nginx process should be further stripped away from the Seafile like the database and memcached. Even after patching the template file, I get "Page unavailable due to a server hiccup". |
@renfeipeng did you close this in favor of #167? I would like to make two suggestions for future issues:
Many people use reverse proxies so they can host multiple services on a single VPS. Here is how I got seafile-docker 7.0.4 working with nginx-proxy:Copy Edit server_name {{ domain }};
- client_max_body_size 10m;
+ client_max_body_size 0;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_read_timeout 310s;
proxy_set_header Host $host;
- proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
+ proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for;proto=$http_x_forwarded_proto";
- proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
- proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header Connection "";
proxy_http_version 1.1;
} (The change to Change your seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
- ports:
- - "80:80"
-# - "443:443" # If https is enabled, cancel the comment.
+ expose:
+ - 80
volumes:
- /opt/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store.
+ - ./seafile.nginx.conf.template:/templates/seafile.nginx.conf.template:ro
environment:
+ VIRTUAL_HOST: seafile.example.test
+ VIRTUAL_PORT: 80
+ LETSENCRYPT_HOST: seafile.example.test
+ LETSENCRYPT_EMAIL: [email protected] The minimal necessary steps to satisfy - proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
+ proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for;proto=$http_x_forwarded_proto";
- proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
- proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Real-IP $proxy_add_x_forwarded_for; However, to make
Otherwise variables like |
Thank you for your suggestion, I think what you said is very reasonable. |
@Redsandro BTW I think the X-Real-IP header should keep "real ip". |
@lcdtyph
Great! 👍 I thought I read that, but wasn't sure. Just mentioned 'might be empty' so no mistakes will be made.
I'm not sure what you mean. The X-Real-IP should be the real internet-facing customer IP. So we need an
In my example I'm using $proxy_add_x_forwarded_for because it will always be the final ip address (in case of maximum 1 proxy, which is the case with nginx-proxy) |
I just added a pull request to improve the docker image #187, one fix being using it behind a SSL termination proxy (I'm using it inside a kubernetes cluster) Suggestions: Update: Looking at an nginx ingress controller setup I see more interesting stuff that could make it into the image + maybe different method of defining the nginx configuration lines. |
Unfortunately I'm not able setting up seafile behind my nginx reverse proxy (nginx, jwilder/docker-gen and jrcs/letsencrypt-nginx-proxy-companion). Neither the workaround from @shoeper nor the workaround from @Redsandro are working for me. Does anyone know if this repository is still maintained and if there are any plans in fixing the problem? |
@patrick-birkle I updated today my PR, added info on the environment variables used and also created a docker image at https://hub.docker.com/repository/docker/cr1st1p/seafile-server |
@Redsandro: Your comment helped me to make seafiles web-ui accessible behind an nginx-proxy. Thank you very much! However, clients are still unable to sync, I guess thats because of fastcgi. Will this be solved with your PR and do you have a workaround in the meantime? What I can see in nginx-proxy logs is
and nothing in seafile logs. Clients display "waiting for sync" with a grey icon. |
@saimonsez I'm not sure why it doesn't work for you. The clients connect over the same port, right? The web-ui address is the same address you enter into the client when connecting, right? If the client connection doesn't work, but the web-ui connection does work, then I'm not sure why this is. Are you connecting to a different url? Seafile did change from version 6 to 7 in the meantime. I'll post my updated files in case it helps you:
|
@Redsandro, thanks for the update. I adopted your seafile.nginx.conf.template and my docker-compose.yml is
and docker-compose.yml of nginx-proxy
Thats not exaclty as yours but should fit. Still, clients can not sync. Do you use any other env variables or special nginx config of jwilder/proxy? |
@saimonsez You need to add |
@cr1st1p sorry for my late reply, thank's for your answer and effort in providing your image. It worked good with your image. After a few days I was still not fully happy with this solution, so I started investigating a bit more. I now found out, that since docker image version 7.0.11 the workaround from @Redsandro (changing the proxy_headers) is not working anymore. If I have more time in the next few days I will try to investigate which changes were made from version 7.0.10 to 7.0.11. Unfortunately I couldn't find any conspicuous changes while skimming the changelog. |
@patrick-birkle so it stopped working in 7.0.11? Thanks for the heads up! I'll make sure not to update my container! |
Right, I'm currently running seafile 7.0.10 docker image without problems. When changing to the 7.0.11 image I get the |
This might also explain why @saimonsez couldn't get it to work. |
I will check that on saturday if I find some time. |
The latest seafile-mc is 5 months old and the version is 7.0.5: https://hub.docker.com/r/seafileltd/seafile-mc/tags. What image are you using? |
Sorry for the missunderstanding. Since I'm hosting seafile only for 2 users I'm currently using the seafile-pro-mc image (pro version is free up to 3 users). You can get pro images from their own image repository. You can find further information about it here. To be honest, until now I didn't know that the image for the community edition is only available until version 7.0.5. Sorry for that. |
This is the latest stable CE release. Pro and CE versions do not necessarily match. |
Now I am completely confused. To narrow down the problem, I created another seafile instance running on https://temp.domain.com. So, no configuration leftovers or anything else - just a fresh installation from scratch. The docker-compose.yml looks like this:
I decided to match my configuration with the one from @Redsandro regarding the networks. seafile.nginx.conf.template and docker-compose.yml of nginx-proxy are still the same. The result is extremely unstable, as I am getting constantly
Sometimes, the login page gets loaded, but I cannot login. |
@saimonsez I also have mariadb:10.1 I'm using |
@saimonsez Coincidentally I ran into the same issue a few moments ago
For me the problem always appears when I'm trying to login only with my username and not my email address. Have you tried logging in with your email or with your username? |
It's working now. That 'Page unavailable' error occured because of memcached not being reachable which was caused by #196. Overall it took me a couple of days to migrate to seafile-docker and put it behind a nginx-proxy, just because this image seems to ignore multiple docker conventions and best practices. edit: Android clients still fail to auto-upload photos ('upload failed'). Could someone with a working reverse-proxy setup verify this? |
Could this please be labeled as a bug and not as a question. At the current state, seafile-docker only works partialy behind nginx-proxy. Some of my Libraries fail to sync and as mentioned, auto-upload of photos does not work at all. Using seafile-docker without a proxy, I do not have these problems. My guess is, that #187 could solve this. |
Confirming. I switched from nextcloud to seafile using most of my previous nginx proxy (forces ssl) and have the same issue. |
I struggled to setup a fresh empty seafile-mc 7.0.5 using jwilder nginx-proxy with letsencrypt companion. I implemented the answer here: I added the config I previously used with docker seafile server 6.2.5 and now it syncs. The config is at: https://github.com/dgleba/proxy457/blob/master/vol/nginx/vhost.d/sf3.dg.jgleba.com
The repo is what I am using. See the seafile3 service in https://github.com/dgleba/proxy457/blob/master/docker-compose.yml I am not sure what I did was good practice. Further investigation is needed, but it is working right now. |
I modify
The # -*- mode: nginx -*-
server {
listen 80;
server_name seafile.example.com;
client_max_body_size 10m;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for;proto=$http_x_forwarded_proto";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header Connection "";
proxy_http_version 1.1;
client_max_body_size 0;
access_log /var/log/nginx/seahub.access.log seafileformat;
error_log /var/log/nginx/seahub.error.log;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_request_buffering off;
access_log /var/log/nginx/seafhttp.access.log seafileformat;
error_log /var/log/nginx/seafhttp.error.log;
}
location /seafdav {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_read_timeout 1200s;
client_max_body_size 0;
access_log /var/log/nginx/seafdav.access.log seafileformat;
error_log /var/log/nginx/seafdav.error.log;
}
location /media {
root /opt/seafile/seafile-server-latest/seahub;
}
# For letsencrypt
location /.well-known/acme-challenge/ {
alias /var/www/challenges/;
try_files $uri =404;
}
}
|
@k997 Work! |
Hey guys! I got a solution for the network problems the problem by jwilder is the client_max_body_size. There's no setting so the max upload ist 1M. I solved it by a new file and a new line in docker-compose.yml at the proxy-container. Look here for a complete explaination: https://github.com/strahli30/HowTo-use-Docker-Seafile-Plex-NGINX In short:
After restart of Seafile and Nginx all works fine! :-) |
As of version 10.0.0, the solution originally posted by @Redsandro still works. @k997's solution also works. The difference between @Redsandro's solution and @k997's solution is that @Redsandro proposes editing the template file which is used to generate an Nginx config file ( One thing to know if you are using @Redsandro's solution (and maybe why many here are struggling and eventually finding success with @k997's solution) is that the config file generation seems to only happen once, when the container's file system is first created. Running |
I will close the issue. New thread with proper title can be opened if more discussions are needed. |
contradictory scheme handlers
Doesn't happen with 6.2.5.
The text was updated successfully, but these errors were encountered: