forked from JensErat/docker-seafile
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
45 lines (42 loc) · 1.77 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
server {
listen 80;
server_name #NGINX_SERVER_NAME#;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
}
server {
listen 443;
ssl on;
ssl_certificate #SSL CERTIFICATE#;
ssl_certificate_key #SSL KEY#;
server_name #NGINX_SERVER_NAME#;
set $fileserver_stream "http://#SEAFILE IP#:#FILESERVER PORT#";
set $seahub_stream "#SEAFILE IP#:#SEAHUB PORT#";
resolver 172.17.42.1 valid=500s;
location / {
fastcgi_pass $seahub_stream;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass $fileserver_stream;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
}
location /media {
root #MEDIA DIR#;
}
}