Problem with Plex and Owncloud reverse proxies cohabitation

14 Views Asked by At

TL;DR: I can't get to work both owncloud and plex through my website reverse proxied by nginx under ubuntu 22 and the Organizr CMS. Here is a pastebin of the server block, the plex reverse proxy, then the owncloud reverse proxy. What can I do to fix that? Is there a way to isolate owncloud security rules to apply to the plex configuration?

https://pastebin.com/qmZiEmtZ

I was having a lot of trouble loading an owncloud server through my private web server's reverse proxies (powered with Organizr). But I got it mostly right, with a very simple reverse proxy:

location /owncloud {
auth_request /organizr-auth/0;
proxy_pass https://192.168.1.8:443/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;

But I still have one thing that troubles me: when the page loads, I have this 'Encountered problem accessing the folder /' message.

I got a fix for that by adding some rules to the reverse proxy (see at the bottom of the paste bin, after these rules. https://pastebin.com/qmZiEmtZ)

And it worked like a charm. Except that now Plex isn't loading anymore, and I get an error 500.

I tried everything to isolate which line were responsible, and it is also the more important ones. Plex seems to not respond well when I activate those lines in owncloud's reverse proxy:

add_header Referrer-Policy no-referrer;

#     Adding the cache control header for js and css files
#    Make sure it is BELOW the PHP block
location ~* \.(?:css|js)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=7200";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets#  access_log off;
}

location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
#      access_log off;
}

The Plex reverse proxy is in this pastebin

https://pastebin.com/qmZiEmtZ

I don't know how this is interacting with plex, but I can't just deactivate them to make owncloud fully works. But if I don't, Plex is useless. Does anyone see where is my trouble and if there is a way I can isolate a configuration from the other. I try to put them in different folder and I tried to make them both load first, but every time its the same error:

  • 'Encountered problem accessing the folder /' on owncloud if I deactivate them

  • Error 500 in Plex if I activate them.

Is there a way to make them cohabit? Or otherwise an other way to isolate these extra rules I need for Owncloud from each other?

0

There are 0 best solutions below