Skip to content

Nextcloud behind reverse proxy - WOPI URL changed from https to http

I'm trying out the "Nextcloud Office" app together with "Collabora Online - Built-in CODE Server". That Nextcloud instance is behind a reverse proxy.

The problem I encountered was that regardless of the 'overwritehost' and 'overwriteprotocol' settings, the WOPI URL kept being automatically changed from https to http.

From other posts regarding similar issues I figured out that the WOPI URL is obtained by querying https://[yourinstance]/apps/richdocumentscode/proxy.php?req=/hosting/discovery

Looking at the proxy.php source code, I found the reason for the issue:
// URL into this server of the proxy script.
if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' )
|| (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on')
) {
$proxyURL = "https://";
} else {
$proxyURL = "http://";
}

I then modified my reverse proxy (Apache) config to add the missing header:
RequestHeader set X-Forwarded-Proto "https"

Now everything works as expected :-)


  • Twitter
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Nextcloud behind reverse proxy - WOPI URL changed from https to http
  • Mixx Nextcloud behind reverse proxy - WOPI URL changed from https to http
  • Bloglines Nextcloud behind reverse proxy - WOPI URL changed from https to http
  • Technorati Nextcloud behind reverse proxy - WOPI URL changed from https to http
  • Fark this: Nextcloud behind reverse proxy - WOPI URL changed from https to http
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at YahooMyWeb
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at Furl.net
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at reddit.com
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at blinklist.com
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at Spurl.net
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at NewsVine
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at Simpy.com
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http at blogmarks
  • Bookmark Nextcloud behind reverse proxy - WOPI URL changed from https to http with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options