Last active
April 14, 2017 02:45
-
-
Save grokdesigns/017204633394623c723c875254955630 to your computer and use it in GitHub Desktop.
Remote Seafile NGINX Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Files HTTPS Redirect | |
server | |
{ | |
listen 80; | |
server_name HOSTNAME; | |
return 301 https://HOSTNAME$request_uri; | |
} | |
# Files Server Proxy | |
server | |
{ | |
listen 443 ssl http2; | |
server_name HOSTNAME; | |
access_log /var/log/nginx/HOSTNAME.access.log combined buffer=16k; | |
error_log /var/log/nginx/HOSTNAME.error.log; | |
include ssl.conf; | |
client_max_body_size 512M; | |
location / | |
{ | |
fastcgi_pass SEAFILE_REMOTE_IP:8000; | |
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 REMOTE_ADDR $remote_addr; | |
fastcgi_param HTTPS on; | |
fastcgi_param HTTP_SCHEME https; | |
fastcgi_read_timeout 36000; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
} | |
location /seafhttp | |
{ | |
rewrite ^/seafhttp(.*)$ $1 break; | |
proxy_pass http://SEAFILE_REMOTE_IP:8082; | |
proxy_connect_timeout 36000s; | |
proxy_read_timeout 36000s; | |
proxy_send_timeout 36000s; | |
send_timeout 36000s; | |
} | |
location /webdav | |
{ | |
fastcgi_pass SEAFILE_REMOTE_IP:8080; | |
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; | |
client_max_body_size 0; | |
proxy_connect_timeout 36000s; | |
proxy_read_timeout 36000s; | |
proxy_send_timeout 36000s; | |
send_timeout 36000s; | |
proxy_request_buffering off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment