Collabora automatically adds port number after URL

I have set up a Nextcloud and Collabora server on my NAS. I deployed it on TrueNAS SCALE and implemented a reverse proxy using NGINX.

Everything works well, but when I enter my Collabora URL in Nextcloud office setting, it automatically appends the port number at the end (collabora.mydomain.com:9980). It seems that this happens after the communication with Collabora. Initially, it shows a green indicator, which means the communication is working well, but after a while, it turns red.

When I change the server_name in the Collabora settings to collabora.mydomain.com:443, it works well. This seems to be because I have set --o:ssl.termination=true, allowing all external connections to use SSL.

When I manually append the port number, it seems collabora no longer adds the port 9980 because it recognizes the port number. According to the nextcloud.log, only port :443 is appended.

Now it works well, but is there another way to prevent Nextcloud from automatically appending the port number after communicating with Collabora? Could it be an issue with NGINX? I have configured all SSL settings in the NGINX web UI, and in the advanced settings, I have the following configuration:

# static files
location ^~ /browser {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Host $host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Host $host;
}

# Capabilities
location ^~ /hosting/capabilities {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Host $host;
}

# main websocket
location ~ ^/cool/(.*)/ws$ {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 36000s;
}

# download, presentation and image upload
location ~ ^/(c|l)ool {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Host $host;
}

# Admin Console websocket
location ^~ /cool/adminws {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 36000s;
}

I set this up by reading the Collabora documentation.

I have limited knowledge about server-related topics, so I’m not sure what additional information I should provide. I apologize for that. If there are specific logs or information that would help in resolving the issue, please let me know, and I will attach them.
Also, I’m not very good at English, so I have received help from AI.

Hello @yoonsangmin welcome to collabora online forums :slight_smile:

No problem at all. You have described the issue very well. Good work on that :+1:

Check Collabora Logs

Look at the Collabora logs to see if there are any indications of mismatched URLs or if it’s explicitly trying to redirect to port 9980. That can give more insight into where the configuration mismatch might be.

Also if possible can you share the logs ?

Thanks,
Darshan

hii @yoonsangmin did your problem solved ?

@darshan Thank you for your response.

I am currently busy and haven’t been able to check. My Nextcloud setup is tangled, so I need to migrate it anew. I will let you know as soon as I have checked. Thank you.

I have reconfigured Nextcloud. I want to check the logs, but I’m not sure which logs to look at. I tried printing the Docker logs but couldn’t find anything meaningful.

I attempted to retrieve Collabora app logs, but I noticed in the coolwsd.xml file that the <logging> <file enable="false"> option is set to false. I’m unsure how to change it to true when running the container in Docker. Could you provide guidance on how to enable logging in this case?
Also, I didn’t see any logs in the browser admin console, and I believe it’s because of this line: <browser_logging desc="Logging in the browser console" default="false">false</browser_logging>. It also didn’t change, even after using the environment variable. I may not know the correct way to modify it. Could you help with that?

I apologize for not knowing much. I would really appreciate any help you can provide. Thank you in advance!