Struggling with NGINX in Docker Linuxserver container on openmediavault development server and would appreciate some advice! Sorry if this question has been answered millions of times before but I can't seem to find an answer which I understand :(
Physical location of relevant web files on server...
volume
|__websites
.....|__content
.....|__database
..........|__connect.php
.....|__scripts
.....|__www
..........|__index.php
NGINX config
server {
..listen 80 default_server;
..listen 443 ssl;
..root /config/www;
..index index.html index.htm index.php;
..server_name omv;
..ssl_certificate /config/keys/cert.crt;
..ssl_certificate_key /config/keys/cert.key;
..client_max_body_size 0;
..autoindex on;
..location ~ \.php$ {
....fastcgi_split_path_info ^(.+\.php)(/.+)$;
....# With php5-cgi alone:
....fastcgi_pass 127.0.0.1:9000;
....# With php5-fpm:
....#fastcgi_pass unix:/var/run/php5-fpm.sock;
....fastcgi_index index.php;
....include /etc/nginx/fastcgi_params;
..}
}
Docker container maps "volume/websites/www" to "config/www" (using Portainer)
The issue is that there is a line in index.php...
require('../database/connect.php');
...which is generating an error...
Warning: require(../database/connect.php): failed to open stream: No such file or directory in /config/www/index.php on line xx
Fatal error: require(): Failed opening required '../database/connect.php' (include_path='.:/usr/share/php7') in /config/www/index.php on line xx
I never have any issues on my production server with Apache accessing files outside the webroot so I know this is a NGINX config issue but I have no idea how to solve it.
Thank you for helping.