Nginx Reverse Proxy for Seafile Redirecting Instead of Proxying

server

#1

Hello all,

I’m experiencing an issue where my nginx reverse proxy is simply redirecting my clients to the actual seafile/hub web interface.

Here’s my config:

server  {
  listen  443 ssl;
  server_name  seafileproxy.mydomain.com;
  proxy_set_header X-Real-IP $remote_addr;
  ssl  on;
  ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
  ssl_session_cache shared:TLS:2m;
  ssl_buffer_size 4k;
  ssl_stapling on;
  ssl_stapling_verify on;
  ssl_protocols       TLSv1.2 TLSv1.3;
  ssl_dhparam    /opt/cert/dhparams.pem;
  ssl_certificate /etc/letsencrypt/live/you.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/you.com/privkey.pem;
location ^~ /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass https://192.168.0.1:443;
    client_max_body_size 0;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
    proxy_set_header HOST $host;
    proxy_set_header Referer $http_referer;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
}

location ~ / {
    proxy_pass https://192.168.0.1:443;
    proxy_set_header HOST $host;
    proxy_set_header Referer $http_referer;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Are there any suggestions for what I’m missing here? Can provide any other info that might be needed.