i have apache set up as my proxy and the web interface is working ok until i try to upload a file then i get a network error.
i have set
SEAFILE_SERVER_HOSTNAME=mydomain.com
SEAFILE_SERVER_PROTOCOL=https
so i must be missing something on the apache proxy config, but cant see what.
i have my proxy on port 8443
my apache site config is:-
<VirtualHost *:8443>
ServerName mydomain.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine On
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
ProxyPass /seafmedia http://127.0.0.1/seafmedia
ProxyPassReverse /seafmedia http://127.0.0.1/seafmedia
<Location /seafmedia>
Require all granted
</Location>
ProxyPass /seafhttp http://127.0.0.1:8080
ProxyPassReverse /seafhttp http://127.0.0.1:8080
RewriteRule ^/seafhttp - [QSA,L]
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
# Proxy for Seafile services
ProxyPass /sdoc-server/ http://127.0.0.1:8888/
ProxyPassReverse /sdoc-server/ http://127.0.0.1:8888/
# Optionally for WebSocket support
ProxyPass /socket.io http://127.0.0.1:8888/socket.io
ProxyPassReverse /socket.io http://127.0.0.1:8888/socket.io
</VirtualHost>
A possible problem is that you are running on 8443. There have been other threads here with people having trouble getting things working on any port other than 443. I don’t think non-standard ports are supported anymore. I don’t know that this is causing the problem, but it might be.
also
I am not very good with apache, but I tried to compare your config to my nginx reverse proxy config. It looks like your config does these things:
So, it looks like your config has several sections you don’t really need which could be causing or contributing to the problem. These are probably left over from instructions for seafile before docker. Now with docker you have an nginx inside the seafile container doing some of that for you so you don’t need apache doing it anymore.
You probably want to cut down to just the /socket.io and /sdoc-server to forward those things to seadoc, and the “everthing else” / forwarding to seafile.
It looks to me like that should work. I guess the next step would be to find out specifically what is failing. In your browser, get to where you are looking at a library, then hit the F12 key, and go to the network section. Then drag a small file into the window to upload it. That network section should show a list of URLs that were accessed and the result of each item. It will be things like api/v2.1/repos/18404316-945a-4420-9ccf-51bd884a758c/file-uploaded-bytes/?parent_dir=%2F&file_name=syslog
ok, when i do that the network window shows
/api/v2.1/repos/c6ecc733-15fa-44d3-a738-9a766dd2d540/file-uploaded-bytes/?parent_dir=%2F&file_name=71422825.pdf with status 200 ok
then
seafhttp/upload-aj/edc2d67f-ed8d-41d2-b741-18eb2861d297?ret-json=1 404 not found
with a red cross next to it in the list
after looking at the actual errors listed by chrome i could see it was a CORS error.
i might be using a sledgehammer to crack a walnut, but i put this in my seahub_settings.py