Open mikekuzak opened 3 years ago
You can edit the $config['base_url']
property in config.php after the first run. If you want it to work like the other container where you can pass in an environment, you could submit a pull request to do so.
Another solution and a better solution is to use HTTP request headers:
$_current_headers = apache_request_headers();
$_url_scheme = $_current_headers['X-Forwarded-Proto'] ?? 'http';
$_url_host = $_current_headers['X-Forwarded-Host'] ?? $_SERVER['SERVER_NAME'];
$_url_port = $_current_headers['X-Forwarded-Port'] ?? $_SERVER['SERVER_PORT'];
$config['base_url'] = $_url_scheme . '://' . $_url_host . ':' . $_url_port;
Edit
config.php
file allowing to configure thebase_url
setting
Another solution and a better solution is to use HTTP request headers:
$_current_headers = apache_request_headers(); $_url_scheme = $_current_headers['X-Forwarded-Proto'] ?? 'http'; $_url_host = $_current_headers['X-Forwarded-Host'] ?? $_SERVER['SERVER_NAME']; $_url_port = $_current_headers['X-Forwarded-Port'] ?? $_SERVER['SERVER_PORT']; $config['base_url'] = $_url_scheme . '://' . $_url_host . ':' . $_url_port;
Edit
config.php
file allowing to configure thebase_url
setting
This breaks the observium cron with the following error.
HP Fatal error: Uncaught Error: Call to undefined function apache_request_headers() in /config/config.php:41
Stack trace:
#0 /opt/observium/includes/sql-config.inc.php(25): require()
#1 /opt/observium/config_to_json.php(20): require_once('...')
#2 {main}
thrown in /config/config.php on line 41
ERROR: Could not load or parse observium configuration from config_to_json.php, are PATHs correct?
Hi,
Tried to run this behind a reserve-proxy (traefik 2.0)
Some files are trying to add always the default port to the dns https://observium.containers.mycompany.com:**8668**/js/jquery.min.js?v=20.9.10731
instead of
https://observium.containers.mycompany.com/js/jquery.min.js?v=20.9.10731
Is there a way to pass in the host dns/port ? Similar to this one: https://github.com/somsakc/docker-observium#a-manual-run-containers