Redirects to localhost:8000 after moving to https


I’ve got a problem after moving Seafile Server 6.0.7 to https (on Windows Server 2016 and IIS 10). All works fine except web interface. I’m trying to access it via, but it redirects to http://localhost:8000/accounts/login?next=/.

There is a IIS redirect rule.

<?xml version="1.0" encoding="UTF-8"?>
                <requestLimits maxUrl="6144" maxQueryString="4096" />
                <clear />
				<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
					<match url="(.*)" />
					<conditions logicalGrouping="MatchAny">
						<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
					<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
                <rule name="Seafile" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:8000/{R:1}" />
                        <set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
                        <set name="HTTP_X_FORWARDED_SCHEME" value="https" />
                        <set name="HTTP_X_FORWARDED_PROTO" value="https" />

The same rule works perfectly with other internal services except Seafile.

Seafile configs:


USER_NAME = company-seafile
ID = 44fece35473682084bfa71f7b3236ac170363b4d
NAME = company-seafile

PORT = 10001

PORT = 13418

HOST = localhost:389
BASE = dc= company,dc=local
USER_DN = seafile@company.local
PASSWORD = password


type = sqlite

port = 12001

port = 8082

port = 8000
fastcgi = false

It seems I need to set some extra IIS redirection rule specially for Seafile? Have anybody faced with the similar problem?

Thank you.

Don’t know if it will solve your problem, but why you have in SERVICE_URL space between subdomain and domain?

Sorry, holantomas. Actually there is no space in the config. This is type only here in forum.

Unfortunately this topic didn’t help. I just changed it exactly as described there.

Web UI settings have higher priority than those in the config file. Did you set those?

Yes, there are correct URLs in the Web UI settings:

@DerDanilo I think it’s not on settings cause by experiences, it work with different settings and only download and upload files are messed up (redirected).

Can you provide change IIS settings?

It is completely as in the guide above. Please see it here:

Or some other settings can say more?

OK, please clean seafile/seahub cache and IIS(if have some). And restart your IIS, seafile and seahub

It doesn’t help :frowning:

There are ending my ideas. You have to wait for someone who knows IIS or just try to google proxy_pass on IIS.

Thank you for helping. Will try something else :slight_smile:

Why not try apache/nginx on Windows. Is the docker image an option for you?

Not really want to try it - we have several services working on IIS. It will make harder to understang what is going on in the server. But of course, if there will no solution, I will try any other solution.