Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

unable to access nextcloud using reverse proxy

Featured Replies

Hey guys. Having some issues with nextcloud/swag setup. Hoping someone can point me in the right direction here. What I am trying to accomplish is to use SSL/Letsencrypt to access my resources ONLY locally. In unraid I've configured swag in bridge0 network which is on my local network.

I created a DNS record of nextcloud.mydomain.com pointing to 10.100.100.4 (SWAG proxy)

Configured the config file for nextcloud as per below

Configured the .conf file in SWAG for nextcloud as per below

When I try to access nextcloud.mydomain.com it gives me a 502 Bad Gateway

When I try to access via the IP of 10.100.100.20:444 it rewrites the url to nextcloud.mydomain.com and I get a bad gateway. Not sure what I'm doing wrong here. Any pointers?

 

image.png.c24ef61a173e2662937342f86a35ee49.png

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ocsdasd21a45',
  'passwordsalt' => '##',
  'secret' => '##',
  'trusted_domains' => 
  array (
    0 => '10.100.100.20:444',
	1 => 'nextcloud.mydomain.com',
  ),
  'trusted_proxies' => ['swag'],
  'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
  'overwritehost' => 'nextcloud.mydomain.com',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  
  'dbname' => 'nextcloud',
  'dbhost' => '10.100.100.20:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'mypassword',
  'installed' => true,
);
---------------------------------------------------

## Version 2020/12/09
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwrite.cli.url' => 'https://nextcloud.your-domain.com/',
#  'overwritehost' => 'nextcloud.your-domain.com',
#  'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'nextcloud.your-domain.com',
#  ),

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nextcloud.mydomain.com;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        proxy_pass https://10.100.100.20:444;
        proxy_max_temp_file_size 2048m;
    }
}
 

 

 

 

 

Edited by fluxcapacitor

  • Author

Bumping for visibility 

No particular help (sorry), I don't use Swag.

 

Have you tried NGINXProxyManager?  Much easier to use and no config files to mess with.

 

Just forward the port on the firewall and create a Proxy Host.  Job done.

  • Author
41 minutes ago, simono5 said:

No particular help (sorry), I don't use Swag.

 

Have you tried NGINXProxyManager?  Much easier to use and no config files to mess with.

 

Just forward the port on the firewall and create a Proxy Host.  Job done.

Can you clarify what you mean by forwarding  the port on the firewall? I'm trying to keep everything internal and not open any ports on the FW for any external access. 

Sorry I meant on your router.  If I remember you forward ports 80 and 443.  I forward to 180 and 1443 and set these up in NGINX in the docker container.

 

It's really straight forward and works really reliably.

  • 3 months later...
On 1/21/2021 at 8:23 AM, fluxcapacitor said:

Hey guys. Having some issues with nextcloud/swag setup. Hoping someone can point me in the right direction here. What I am trying to accomplish is to use SSL/Letsencrypt to access my resources ONLY locally. In unraid I've configured swag in bridge0 network which is on my local network.

I created a DNS record of nextcloud.mydomain.com pointing to 10.100.100.4 (SWAG proxy)

Configured the config file for nextcloud as per below

Configured the .conf file in SWAG for nextcloud as per below

When I try to access nextcloud.mydomain.com it gives me a 502 Bad Gateway

When I try to access via the IP of 10.100.100.20:444 it rewrites the url to nextcloud.mydomain.com and I get a bad gateway. Not sure what I'm doing wrong here. Any pointers?

 

image.png.c24ef61a173e2662937342f86a35ee49.png


<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ocsdasd21a45',
  'passwordsalt' => '##',
  'secret' => '##',
  'trusted_domains' => 
  array (
    0 => '10.100.100.20:444',
	1 => 'nextcloud.mydomain.com',
  ),
  'trusted_proxies' => ['swag'],
  'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
  'overwritehost' => 'nextcloud.mydomain.com',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  
  'dbname' => 'nextcloud',
  'dbhost' => '10.100.100.20:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'mypassword',
  'installed' => true,
);
---------------------------------------------------

## Version 2020/12/09
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwrite.cli.url' => 'https://nextcloud.your-domain.com/',
#  'overwritehost' => 'nextcloud.your-domain.com',
#  'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'nextcloud.your-domain.com',
#  ),

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nextcloud.mydomain.com;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        proxy_pass https://10.100.100.20:444;
        proxy_max_temp_file_size 2048m;
    }
}

 

 

 

 

 

 how do you access that config file? i cant seem to find my copy. 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.