LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 06-08-2019, 01:16 PM   #1
Superspeed500
Member
 
Registered: Oct 2017
Distribution: Fedora, Ubuntu
Posts: 37

Rep: Reputation: Disabled
Show client IP in Nextcloud 16 in docker container behind Nginx on Ubuntu 18.04


I have a nextcloud install using the official docker image. The install works perfectly, except that I can't get the correct client IP in inside the docker container.

My nextcloud config file:
PHP Code:
<?php
$CONFIG 
= array (
  
'htaccess.RewriteBase' => '/',
  
'memcache.local' => '\\OC\\Memcache\\APCu',
  
'apps_paths' => 
  array (
    
=> 
    array (
      
'path' => '/var/www/html/apps',
      
'url' => '/apps',
      
'writable' => false,
    ),
    
=> 
    array (
      
'path' => '/var/www/html/custom_apps',
      
'url' => '/custom_apps',
      
'writable' => true,
    ),
  ),
  
'instanceid' => '[CENSORED]',
  
'passwordsalt' => '[CENSORED]',
  
'secret' => '[CENSORED]',
  
'trusted_domains' => 
  array (
    
=> '127.0.0.1:8080',
    
=> 'cloud.superspeed500.lan',
  ),
  
'overwritehost' => 'cloud.superspeed500.lan',
  
'overwriteprotocol' => 'https',
  
'overwritewebroot' => '/',
  
'overwrite.cli.url' => 'http://cloud.superspeed500.lan',
  
'trusted_proxies' => 
  array (
    
=> '172.17.0.1',
    
=> '192.168.50.41',
    
=> '127.0.0.1',
  ),
  
'forwarded_for_headers' =>
  array (
    
=> 'HTTP_X_FORWARDED_FOR',
  ),
  
'datadirectory' => '/var/www/html/data',
  
'dbtype' => 'mysql',
  
'version' => '16.0.1.1',
  
'dbname' => 'nextcloud',
  
'dbhost' => '[CENSORED]',
  
'dbport' => '',
  
'dbtableprefix' => 'oc_',
  
'mysql.utf8mb4' => true,
  
'dbuser' => '[CENSORED]',
  
'dbpassword' => '[CENSORED]',
  
'maintenance' => false,
  
'installed' => true,
  
'data-fingerprint' => '[CENSORED]',
  
'mail_from_address' => '[CENSORED]',
  
'mail_smtpmode' => 'smtp',
  
'mail_sendmailmode' => 'smtp',
  
'mail_domain' => '[CENSORED]',
  
'mail_smtphost' => '[CENSORED]',
  
'mail_smtpport' => '25',
  
'loglevel' => 2,
  
'ldapIgnoreNamingRules' => false,
  
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);
The nginx proxy is located at the address 172.17.0.1 [docker0] and 192.168.50.41 [main interface].

The nginx access log shows the correct IP-address for connection clients.

My nginx config for cloud:
Code:
# Nginx config for Nextcloud proxy

# Redirect to HTTPS
server {
  listen 80;

  return 301 cloud.superspeed500.lan;
  server_name cloud.superspeed500.lan;

}

# Redirect to actual server
server {
  listen 443 ssl;
  server_name cloud.superspeed500.lan;

  ssl_certificate /etc/ssl/certs/s500cloud.ssl.crt;
  ssl_certificate_key /etc/ssl/private/s500cloud.ssl.key;
 
  client_max_body_size 0;
  underscores_in_headers on;
 
  location ~ {
    # Address where nextcloud lives
    proxy_pass http://localhost:8080;

    proxy_set_header X-Forwarded-For $remote_addr;
    add_header Front-End-Https on;
    add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;

    proxy_buffering off;
    proxy_max_temp_file_size 0;


  }


}
Anyone that knows what I have done wrong?

More configuration files can be supplied on request.
Thanks for any help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Install Nextcloud on Ubuntu 18.04 with Nginx, PHP7.3 and Let's Encrypt SSL LXer Syndicated Linux News 0 04-20-2019 11:48 PM
Nextcloud login loop on Nginx behind Nginx reverse proxy horizn Linux - Server 0 12-27-2018 02:44 PM
LXer: How to Install Nextcloud with Nginx on Ubuntu 18.04 LTS LXer Syndicated Linux News 0 07-14-2018 12:35 AM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
Computers behind router behind computer behind router remi Linux - Networking 1 05-05-2005 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration