Cannot upload through web browser

Upload from desktop client works fine but uploading from browser fails with the following message.

JS Console:

Blocked loading mixed active content "http://[seafile domain]:[seafile server port]/upload-aj/[random letters and numbers with dashes]"

The domain has SSL. http redirects to https.


My apache vhost conf file:

<VirtualHost *:80>
    ServerName sf.domain.tld
    ServerAlias sf.domain.tld2
    DocumentRoot /var/www

    Redirect permanent / https://sf.domain.tld

    ErrorLog ${APACHE_LOG_DIR}/sf_error.log
    CustomLog ${APACHE_LOG_DIR}/sf_access.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerName sf.domain.tld
    ServerAlias sf.domain.tld2

    DocumentRoot /var/www
    Alias /media  /usr/share/seafile/[company name]/seafile-server-latest/seahub/media

    RewriteEngine On

    <Location /media>
        Require all granted
    </Location>

    #
    # seafile fileserver
    #
    ProxyPass /seafhttp http://127.0.0.1:[seafile server port]
    ProxyPassReverse /seafhttp http://127.0.0.1:[seafile server port]
    RewriteRule ^/seafhttp - [QSA,L]

    #
    # seahub
    #
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ProxyPass / http://127.0.0.1:8000/
    ProxyPassReverse / http://127.0.0.1:8000/

  #
  # WebDAV
  # We use http proxy, since SeafDAV is incompatible with FCGI proxy in Apache 2.4.
  #
  ProxyPass /seafdav http://127.0.0.1:[webdav port]/seafdav
  ProxyPassReverse /seafdav http://127.0.0.1:[webdav port]/seafdav

    Include /etc/letsencrypt/SA1.conf

    ErrorLog ${APACHE_LOG_DIR}/sf_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/sf_ssl_access.log combined
</VirtualHost>

My seafile.conf

[fileserver]
port = [seafile server port]

[database]
type = mysql
host = 127.0.0.1
port = 3306
user = seafile
password = [password]
db_name = seafile-db
connection_charset = utf8

Nginx or Apache?

Apache. Please check my edit in OP, I included the vhost file.

Why do you hide those? ==> They should be behind your reverse proxy and including a properly setup firewall this information is not even dangerous to show online.

What is the reason that you seem to have changed those ports?

So far your config does not look wrong.

Overall I recommend to use a local nginx reverse proxy. It just works better, is easier to setup, has more options and uses way less resources. :slight_smile:

This is my first time hosting stuff on the web and I am paranoid. :sweat_smile:

Overall I recommend to use a local nginx reverse proxy. It just works better, is easier to setup, has more options and uses way less resources.

I chose Apache because I am familiar with it. Meaning to try nginx for a while.

But I think the issue is with seafile and not the server. It is requesting http://[seafile domain]:[seafile server port]/upload-aj/[random letters and numbers with dashes] instead of https://[seafile domain]:[seafile server port]/upload-aj/[random letters and numbers with dashes]

I wonder why seafile is doing that…

Please post your Seafile config. You should not have to put the server port unless it’s not 80 or 443.
Are your Seafile urls configured correctly? (Settings in WebUI have higher prio!).

1 Like

Settings in WebUI have higher prio

The FILE_SERVER_ROOT was something else in the WebUI. And it was http. I never touched it untill now. I wonder why it did not update when I changed seahub_settings.py. I restarted both seafile and seahub many times.

I updated value of FILE_SERVER_ROOT in WebUI to reflect the value in seahub_settings.py.

Now files upload fine from the browser. :smiley:

Thank you! :slight_smile:

1 Like

Hey

I am having the same issue while uploading files.

I am running this using Ubuntu 16.04. The server works just fine but it dosent let me upload files.

I have the server running on https://192.168.0.2:8444. The SSL is handled by nginx.

I checked my seahub_settings.py and it does not contain any FILE_SERVER_ROOT.

In the admin web page, the FILE_SERVER_ROOT is http://192.168.0.2:8082 and the SERVICE_URL is http://192.168.0.2:8000

Thanks

Just to clarify for anyone arriving here later (based on what @Maclaren posted): The FILE_SERVER_ROOT setting is actually in the admin settings in the GUI, not the config files.