NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.98k stars 2.66k forks source link

Collabora #70

Closed wuast94 closed 5 years ago

wuast94 commented 5 years ago

Is it possible to setup this ? i found some config files für nginx but dont know how to port this. for Example:

server {
    listen       443 ssl;
    server_name  office.example.com;

    ssl_certificate /path/to/certficate;
    ssl_certificate_key /path/to/key;

    # static files
    location ^~ /loleaflet {
        proxy_pass https://localhost:9980;
        proxy_set_header Host $http_host;
    }

    # WOPI discovery URL
    location ^~ /hosting/discovery {
        proxy_pass https://localhost:9980;
        proxy_set_header Host $http_host;
    }

   # main websocket
   location ~ ^/lool/(.*)/ws$ {
       proxy_pass https://localhost:9980;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "Upgrade";
       proxy_set_header Host $http_host;
       proxy_read_timeout 36000s;
   }

   # download, presentation and image upload
   location ~ ^/lool {
       proxy_pass https://localhost:9980;
       proxy_set_header Host $http_host;
   }

   # Admin Console websocket
   location ^~ /lool/adminws {
       proxy_pass https://localhost:9980;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "Upgrade";
       proxy_set_header Host $http_host;
       proxy_read_timeout 36000s;
   }
}
jc21 commented 5 years ago

Sure can. I didn't see a default /' location there so I did a google and other commabora examples have one.

  1. Create your new Proxy Host, specify https protocol and the server host/ip and port 9980. Also enable Websockets Support.
  2. On the SSL tab select a new certificate, enable HTTP/2.
  3. On the Advanced tab, enter:
    
    # static files
    location ^~ /loleaflet {
    proxy_pass $forward_scheme://$server:$port;
    proxy_set_header Host $http_host;
    }

WOPI discovery URL

location ^~ /hosting/discovery { proxy_pass $forward_scheme://$server:$port; proxy_set_header Host $http_host; }

main websocket

location ~ ^/lool/(.*)/ws$ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_pass $forward_scheme://$server:$port; proxy_set_header Host $http_host; proxy_read_timeout 36000s; }

download, presentation and image upload

location ~ ^/lool { proxy_pass $forward_scheme://$server:$port; proxy_set_header Host $http_host; }

Admin Console websocket

location ^~ /lool/adminws { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1; proxy_pass $forward_scheme://$server:$port; proxy_set_header Host $http_host; proxy_read_timeout 36000s; }


4. Save and test.
wuast94 commented 5 years ago

worked perfectly :) so thank for that.

would it be an idea to add "presets" for most common services ? so you can add a preset that fills out as many as possible.

jc21 commented 5 years ago

Nice idea. Feel free to create a new issue for that :)

Glad it works for you!

Tucubanito07 commented 3 years ago

worked perfectly :) so thank for that.

would it be an idea to add "presets" for most common services ? so you can add a preset that fills out as many as possible.

Hey could you share how you got it to work? How did you set yours up please? I had mine working before and now it does not work. Any input is greatly appreciated. Is there a config file in nextcloud i have to put that domain of the collabora?

mwip commented 3 years ago

On a related note, what would the advanced section be like when using the nextcloud built-in CODE collabora editor? https://www.collaboraoffice.com/online/connecting-collabora-online-built-in-code-server-with-nginx/

They refer to the following lines in the NC nginx config:

    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {
        fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
        set $path_info $fastcgi_path_info;
        try_files $fastcgi_script_name =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $path_info;
        fastcgi_param HTTPS on;
        # Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        # Enable pretty urls
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }

If this makes any difference: I am using NPM to reverse-proxy into a nextcloudpi installation, which itself uses apache (https://ownyourbits.com/2017/06/12/why-nextcloudpi-uses-apache-and-not-nginx/).

mitohund commented 2 years ago

So it turns out the Collabora team has changed some folders and names and the nginx config from above does not seem to work anymore. After puzzling together the info from various forums, I came up with a working config. However, since I don't really understand what I'm doing, somebody more knowledgeable than me should maybe verify this info. I am, however, quite happy that Collabora / Nextcloud Office is again working for me.

You may also have to clear your browser cache for this to work.

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

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

# Capabilities
location ^~ /hosting/capabilities {
  proxy_pass $forward_scheme://$server:$port;
  proxy_set_header Host $http_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 $http_host;
  proxy_read_timeout 36000s;
}

# download, presentation and image upload
location ~ ^/(c|l)ool {
  proxy_pass $forward_scheme://$server:$port;
  proxy_set_header Host $http_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 $http_host;
  proxy_read_timeout 36000s;
}

Some more info here: https://help.nextcloud.com/t/updated-collabora-nextcloud-and-now-get-404/129873/2 https://help.nextcloud.com/t/nextcloud-office-document-loading-failed-this-request-has-been-blocked-the-content-must-be-served-over-https/130439/3 https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html#reverse-proxy-with-nginx-webserver

DCCInterstellar commented 1 year ago

I'm using this as of June 5, 2023, and it doesn't work. Is anyone able to get this configuration with Collabora in Nginx Proxy Manager?

mitohund commented 1 year ago

@DCCInterstellar sorry, I moved on to Nextcloud AIO a month or two ago, where I did not have to tinker with this anymore. But until then, I believe my above solution worked.

DCCInterstellar commented 1 year ago

@mitohund No worries! I've tried it over and over but for some reason, Collabora kept giving me issues. I decided to let it go and install OnlyOfficeDocumentServer. So far that's been working really well Nextcloud.

mitohund commented 1 year ago

@DCCInterstellar I just noticed that in the above code block there is an unnecessary empty line and empty space, towards the end of the # Capabilities block, just before }. Don't know if this could cause any issues?

DCCInterstellar commented 1 year ago

@mitohund I tried removing the extra block. Still having the same issue, sadly. But thank you for trying to help!

On Wed, Jun 14, 2023 at 4:38 AM mitohund @.***> wrote:

@DCCInterstellar https://github.com/DCCInterstellar I just noticed that in the above code block there is an unnecessary empty line and empty space, towards the end of the # Capabilities block, just before }. Don't know if this could cause any issues?

— Reply to this email directly, view it on GitHub https://github.com/NginxProxyManager/nginx-proxy-manager/issues/70#issuecomment-1590942175, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5TXWPXRBC5XUY3WMP33KETXLGIAXANCNFSM4GX7OJ7A . You are receiving this because you were mentioned.Message ID: @.***>

warioishere commented 1 year ago

same here. I am trying to get this to work since weeks:

https://github.com/CollaboraOnline/online/issues/7063

if anyone has an idea?

dounoit commented 1 year ago

i'll pile on - i can't get this thing to work - i been pullin my hair out - its complaining about unautorized:

wsd-00001-00062 2023-08-29 08:20:56.797140 +0000 [ docbroker_003 ] ERR Unauthorized Request while starting session on https%3A%2F%2Fdkloud.douno.it%3A443%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F9415_ocbn5c6s32h1 for socket #24. Terminating connection. Error: No acceptable WOPI hosts found matching the target host [cloud.fqdn.com] in config| wsd/COOLWSD.cpp:5047 wsd-00001-00062 2023-08-29 08:20:56.812968 +0000 [ docbroker_003 ] ERR #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1122 wsd-00001-00062 2023-08-29 08:20:56.813091 +0000 [ docbroker_003 ] WRN #18: Unassociated Kit (55) disconnected unexpectedly| wsd/COOLWSD.cpp:3497