I’m running nextcloud 12 on apache at port 8888 with nginx as reverse proxy, the below configuration is giving 404 when i hit nextcloud from outside via nginx, but it working fine on internal network hosted on apache.
below are the configuration details.
pi@raspberrypi:~ $ nginx -v
nginx version: nginx/1.10.3
pi@raspberrypi:~ $ apache2 -v
Server version: Apache/2.4.25 (Raspbian)
Server built: 2017-09-19T18:58:57
pi@raspberrypi:~ $ php -v
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
pi@raspberrypi:~ $
Internal URL (directly hits apache) : http://192.168.1.254:8888/nextcloud/
Outside URL (via nginx reverse proxy) : https://cloud.domain.com
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Not Found
The requested URL /nextcloud/nextcloud/index.php/login was not found on this server.
Apache/2.4.25 (Raspbian) Server at cloud.domain.com Port 80
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
pi@raspberrypi:~ $ sudo cat /var/www/html/nextcloud/config/config.php
<?php
$CONFIG = array (
'instanceid' => 'oc0okf3ebww7',
'passwordsalt' => '@@@@@@@@@@',
'secret' => '@@@@@@@@@@@@@@@@@@@@@@@',
'trusted_domains' =>
array (
0 => '192.168.1.254:8888',
1 => 'cloud.domain.com',
2 => 'cloud.domain.com:8888',
),
'datadirectory' => '/var/www/html/nextcloud/data',
'overwrite.cli.url' => 'http://192.168.1.254:8888/nextcloud',
'dbtype' => 'mysql',
'version' => '11.0.2.7',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextclouduser',
'dbpassword' => 'nextcloudpassword',
'logtimezone' => 'UTC',
'installed' => true,
);
pi@raspberrypi:~
Nginx configuration is mentioned below.
server {
listen 443 ssl;
server_name cloud.domain.com;
access_log /var/log/nginx/cloud.domain.com.access.log;
error_log /var/log/nginx/cloud.domain.com.error.log;
client_max_body_size 0;
underscores_in_headers on;
ssl on;
ssl_certificate_key /home/pi/website-ssl-cert/private.key;
ssl_certificate /home/pi/website-ssl-cert/certificate.crt;
ssl_stapling on;
ssl_stapling_verify on;
location / {
proxy_pass http://192.168.1.254:8888/nextcloud/;
proxy_pass_header Authorization;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_request_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
proxy_ssl_session_reuse off;
}
}
Thanks for your help in advance.