-
Caddy version (
caddy version
):
v2.2.1 -
How I run Caddy:
As a front end for Nextcloud, currently just trying to make my internal ip work with a subdirectory /nextcloud
a. System environment:
FreeNAS 11.3 U3.
b. Command:
service caddy start
d. My complete Caddyfile or JSON config:
192.165.49.79:80/nextcloud {
root * /usr/local/www/nextcloud
file_server
log {
output file /var/log/caddyTest.log
format single_field common_log
}
php_fastcgi 127.0.0.1:9000 {
env front_controller_active true
}
# rewrite /index.php/* /index.php?{query}
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
# .htaccess / data / config / ... shouldn't be accessible from outside
@forbidden {
path /.htaccess
path /data/*
path /config/*
path /db_structure
path /.xml
path /README
path /3rdparty/*
path /lib/*
path /templates/*
path /occ
path /console.php
}
respond @forbidden 404
}
-
The problem I’m having:
I cannot get Nextcloud to work using the url base /nextcloud. It works perfect if I change my caddy file to just ip. With ip/nextcloud I get a white page on a browser. -
Error messages and/or full log output:
192.165.49.71 - - [26/Oct/2020:13:06:27 -0400] “GET /nextcloud/status.php HTTP/1.1” 302 0
192.165.49.71 - - [26/Oct/2020:13:06:27 -0400] “GET /apps/files/ HTTP/1.1” 200 39662
192.165.49.71 - - [26/Oct/2020:13:06:29 -0400] “GET /nextcloud/status.php HTTP/1.1” 302 0
192.165.49.71 - - [26/Oct/2020:13:06:29 -0400] “GET /apps/files/ HTTP/1.1” 200 38881
192.165.49.14 - - [26/Oct/2020:13:06:34 -0400] “GET /nextcloud/index.php HTTP/1.1” 0 0
192.165.49.14 - - [26/Oct/2020:13:06:35 -0400] “GET /favicon.ico HTTP/1.1” 0 0
192.165.49.71 - - [26/Oct/2020:13:06:59 -0400] “GET /nextcloud/status.php HTTP/1.1” 302 0
192.165.49.71 - - [26/Oct/2020:13:06:59 -0400] “GET /apps/files/ HTTP/1.1” 200 39668
192.165.49.71 - - [26/Oct/2020:13:07:01 -0400] “GET /nextcloud/status.php HTTP/1.1” 302 0
192.165.49.71 - - [26/Oct/2020:13:07:01 -0400] “GET /apps/files/ HTTP/1.1” 200 38879 -
What I already tried:
In nextcloud config I have tried setting overwritebaseurl to /nextcloud and removed the /nextcloud in caddyfile, this gives me too many reddirect error.
I have tried using ip/nextcloud in caddy file with overwriteurl in nextcloud config.php base as /nextcloud, same thing.
I have tried using ip/nextcloud in caddy file without overwriteurlbase in nextcloud config, this sorta works, using the ip/nextcloud gets the url query to be ip/nextcloud/login but fails with a 404 error.
I have also tried 192.165.49.79:80 {
root /nextcloud* /usr/local/www/nextcloud
but this redeirects back to ip/login with a 404 error. Adding urlbase in nextcloud config gives me the too many redirects error.
Please help me figure this out, I need it to be in a subdirectoy for use with my reverse proxy.