setting up my Dockered Applications (wordpress nextcloud) behind a reverse proxy location in NGINX
if i use NGINX location / wordpress runs out of the box and nextcloud after some configuration in config.php in trusted domains.
So this config is working for both nginx and nextcloud. (i just have to change the ports.
server { server_name localhost; large_client_header_buffers 4 16k; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Host $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://10.0.100.6:8080; } listen [::]:80; listen 80; } But if I want to run them in different location i rly getting into trouble. I tried so many hints on the web since 2 days but nothing worked out from a blank screen over server error to not allowed to view the site etc.
Maybe you guys have some hints what i could try.
I already changed path in wordpress. Try to made proxy configuration on nextcloud ... nothing worked out.
Maybe someone have a running proxy configuration for nextcloud running NOT in / but in another location ? i tried these fix https://gist.github.com/aleksandar-babic/0cdd3244f4bf6b13dbed68de96ba4ab1 for wordpress but nothing worked out for me
I just use http for testing
someone experienced with reverse proxy with locations on nextcloud or wordpress would be fine :)
So what i already tried is this nginx configuration:
server { server_name localhost; large_client_header_buffers 4 16k; location /nextcloud { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Forwarded-Host $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://10.0.100.6:8080; } listen [::]:80; listen 80; } Bringing me to this page:
Nextcloud Page not found
The page could not be found on the server or you may not be allowed to view it.
Back to Nextcloud
Nextcloud – a safe home for all your data
So reverse proxy is working but page not found:
In my opionion its just a configuration issue in config.php from nextcloud
So i read this: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html
This is my config.php file for nextcloud:
<?php $CONFIG = array ( 'htaccess.RewriteBase' => '/', 'memcache.local' => '\\OC\\Memcache\\APCu', 'apps_paths' => array ( 0 => array ( 'path' => '/var/www/html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), 'upgrade.disable-web' => true, 'instanceid' => 'ocd4tnvw6501', 'passwordsalt' => 'y0KSe+aYftr3ruAhjc8P+WME7/UBsV', 'secret' => 'ZCsLngn5eg+M9kkuPHInzt5H8APgWta20lPncnFR244WDxLW', 'trusted_domains' => array ( 0 => '10.0.100.6:8080', 1 => '10.0.100.6:80', 3 => '*', ), 'datadirectory' => '/var/www/html/data', 'dbtype' => 'mysql', 'version' => '28.0.1.1', 'overwrite.cli.url' => 'http://10.0.100.6/nextcloud', 'dbname' => 'db', 'dbhost' => 'mariadb', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'mysqluser', 'dbpassword' => 'somemysqlpassword', 'installed' => true, 'overwritewebroot' => '/nextcloud', 'trusted_proxies' => ['10.0.0.6'], 'overwritehost' => '10.0.0.6', ); I chanched trusted hosts
added this:
'overwritewebroot' => '/nextcloud', 'trusted_proxies' => ['10.0.0.6'], 'overwritehost' => '10.0.0.6', 'overwrite.cli.url' => 'http://10.0.100.6/nextcloud', myabe its just a small configuration issue...