Applied client sync fix in nginx-configuration.

This commit is contained in:
Maximilian Kratz 2020-02-09 11:48:02 +01:00
parent 92346a700e
commit 0fc09e6195
3 changed files with 24 additions and 3 deletions

View file

@ -1,4 +1,4 @@
FROM seafileltd/seafile
MAINTAINER Stefano Marinelli <stefano@dragas.it>
LABEL maintainer="Max Kratz <account@maxkratz.com>"
COPY seafile.nginx.conf.template /templates/

View file

@ -1,6 +1,11 @@
# Seafile Docker container with nginx-proxy fix
Seafile Docker build with fix for nginx-proxy compatibility
Seafile Docker build with fix for nginx-proxy compatibility.
The official seafile docker container has a nginx configuration that blocks nginx-proxy compatibility. This container will follow the official one, applying the small fix.
Refer to official Seafile container for usage: https://github.com/haiwen/seafile-docker
## Fix for the fix
This repo was forked from: https://github.com/draga79/seafile-docker
In my version I've added a small fix to the nginx-configuration to enable successful synchronization with seafile-clients.

View file

@ -1,5 +1,8 @@
# -*- mode: nginx -*-
# Auto generated at {{ current_timestr }}
# This file contains the nginx configuration for the local seafile server
# https check
{% if https -%}
server {
listen 80;
@ -12,6 +15,8 @@ server {
{% if https -%}
listen 443;
ssl on;
# provided certificates in /shared/ssl
ssl_certificate /shared/ssl/{{ domain }}.crt;
ssl_certificate_key /shared/ssl/{{ domain }}.key;
@ -27,11 +32,15 @@ server {
{% endif -%}
server_name {{ domain }};
client_max_body_size 10m;
# normal location for seafile
location / {
proxy_pass http://127.0.0.1:8000/;
# allows file up-/downloads up to 10 Gigabytes
client_max_body_size 10g;
proxy_request_buffering off;
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
@ -41,15 +50,22 @@ server {
proxy_http_version 1.1;
}
# seafhttp for clients
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
# disable client_max_body_size for all clients
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
}
# seafdav for webdav
location /seafdav {
# disable client_max_body_size for webdav clients
client_max_body_size 0;
fastcgi_pass 127.0.0.1:8080;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;