Using official nextcloud image with Swag

Hi everyone

I’d like to use the official nextcloud docker image while using Swag as a reverse proxy.

The reason for this is I’d like Collabora/Code installed ready to go.

I’ve tried for the past few hours but can’t get the config to work. I can access nextcloud via my server IP on an insecure port (8080) but never via secure port 450 or via my subdomain.

  • Do i need the fpm or the apache version of nextcloud (apache I guess?)

Thanks.

1 Like

Do i need the fpm or the apache version of nextcloud (apache I guess?)

Apache of course

If you can access directly to nexcloud than swag is not set correctly.

tip: proxy port 443 should connect to port 8080 of nexcloud. In production direct access to nextcloud should not be allowed.

share your compose and your swag proxy-conf

I got it working eventually. ended up using the LinuxServer Nextcloud image and official Collabora image.

For anyone else in the same boat I found Nextcloud’s built in Collabora server just didn’t work out of the box (even using their official image) and people report it’s too slow. Overall Collabora isn’t as useful/game changing as I thought it would be unfortunately so in future I’d use the set up above rather than trying to get the official NC image to work.

I like using an online office suite and really wanted to get one working through Nextcloud… Collabora was a huge PITA, I agree. I gave up on it

I ended up going with the onlyoffice document server and app on Nextcloud. Was super easy to route through swag w/ my other subdomains

Install/setup nextcloud
Install/setup document server
Install and configure the Only Office add on.

If you want to reverse proxy it, make sure the document server is on your swag network and you’ve set up your domain… then configure it in the app configuration. Very easy to setup.

1 Like

Did anyone ever find a solution to this ? I need to use the official nextcloud image and not the linuxserver one as I require HW video transcoding support which the alpine linuxserver wont support (Sharing a lot of 4k camera footage and previewing with transcoding when offsite is a godsend).

Problem is I cant get swag to communicate with my nextcloud docker instance still. The setup is:

  • Apache nextcloud stack with port 8080:80 being exposed
  • Swag configured with $upstream_app , $upstream_port 8080, $upstream_proto http (have also tried https and ofcourse that dint work)
  • Nextcloud’s config.php set to include trusted_domains, trusted_proxies, overwrite.cli.url, overwritehost & overwriteprotocol. For overwriteprotocol I have tried both http and https

Am I missing anything with how to use the official nextcloud image or will swag only work with the linuxserver nextcloud image ?

If anyone needs this i finally got it working any only pulled out half my hair in the process.

The official docker image only exposes port 80 over http so the changes need to be on the swag config, they should look like:

## Version 2022/10/28
...
server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nextcloud.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app nextcloud; # this is the name of your nextcloud app container
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_hide_header X-Frame-Options;
        proxy_max_temp_file_size 2048m;
    }
}

Also needed to restart the swag container for these to take effect (the swag dashboard reflects the changes but nginx needs a restart in order to work). You could probably issue the below command within swag to accomplish the same

nginx -c /config/nginx/nginx.conf -s reload

Glad you got it sorted. You must always check these things with anything you proxy, if you can’t reach it neither can swag.

fwiw we do not support running commands directly in the container like this. To ensure our continued support if you need it, restart the container :slight_smile:

I know this thread is old but I was wondering if you figured out a way to still make it redirect to https instead of http?

This is what you got to work with the nextcloud/all-in-one:latest image?

It isn’t clear to me what is meant by “official nextcloud image” in this thread. Can someone tell me, please?

2 posts above yours is how he did it for the official variants (which require you to proxy to 80, the included proxy conf is how to do it with ours (which requires you to proxy to 443).

1 Like

any container made by nextcloud is an official container for nextcloud

1 Like

Thank you. I’m trying to do it with the included proxy conf so I’ll stick with 443.

This is the first time I’m used something like the all-in-one master container, which I didn’t realize until a few minutes ago includes/links/??? to all other containers running on the host?!? Now that I’m sort of seeing this, I’m taking another run at things. I’ve got the AIO interface running, now working on ports. I’m being told the server isn’t reachable on port 443 for the portchecker.co reports 443 is open.

I’ll open a new thread if I don’t get it working.

Appreciate ya.

Tim

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.