From bee079297de305dd4fd29a95316746f93a3338be Mon Sep 17 00:00:00 2001 From: furyhawk Date: Mon, 30 Jun 2025 21:03:15 +0800 Subject: [PATCH] feat: add initial nginx configuration for seafile server --- swarm/seafile/seafile.nginx.conf | 77 ++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 swarm/seafile/seafile.nginx.conf diff --git a/swarm/seafile/seafile.nginx.conf b/swarm/seafile/seafile.nginx.conf new file mode 100644 index 0000000..0207ed9 --- /dev/null +++ b/swarm/seafile/seafile.nginx.conf @@ -0,0 +1,77 @@ +# -*- mode: nginx -*- +# Auto generated at 06/30/2025 12:36:47 +server { +listen 80; +server_name seafile.furyhawk.lol; + + client_max_body_size 10m; + + location / { + proxy_pass http://127.0.0.1:8000/; + proxy_read_timeout 310s; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Connection ""; + proxy_http_version 1.1; + + add_header Access-Control-Allow-Origin *; + 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_read_timeout 36000s; + + access_log /var/log/nginx/seafhttp.access.log seafileformat; + error_log /var/log/nginx/seafhttp.error.log; + } + + location /notification/ping { + proxy_pass http://127.0.0.1:8083/ping; + access_log /var/log/nginx/notification.access.log seafileformat; + error_log /var/log/nginx/notification.error.log; + } + + location /notification { + proxy_pass http://127.0.0.1:8083/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + access_log /var/log/nginx/notification.access.log seafileformat; + error_log /var/log/nginx/notification.error.log; + } + + location /seafdav { + rewrite ^/seafdav$ /seafdav/ permanent; + } + + location /seafdav/ { + proxy_pass http://127.0.0.1:8080/seafdav/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + 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 /:dir_browser { + # Logo of WebDAV + proxy_pass http://127.0.0.1:8080/:dir_browser; + } + + location /media { + root /opt/seafile/seafile-server-latest/seahub; + } + +} \ No newline at end of file