So have latest dietpi installed with nginx running nextcloud and pihole. I can access nextcloud and pihole from my domain name outside of my network. But when I enter the LAN ip of my dietpi server all I get is a 404 error. Have looked through all the conf files in /etc/nginx and can’t see any problems
Any tips on what I can check?
Cheers
what is the URL you are using to access PiHole locally?
What is the URL for NexctCloud?
What URL you are using to access from external?
Did you do any manuell configuration on Nginx configuration files?
i’m using http://192.168.1.10/admin and 192.168.1.10/nextcloud, both don’t work locally
but I can use https://mydomain.com/admin and /nextcloud and both work fine.
all config files are standard since setup. Set Nginx as standard web server, installed pihole then nextcloud. Then done dietpi-letsencrypt.
After looking again in default conf file. I found Certbot added a few lines blocking local access. Have now fixed it.
ok it seems to be an issue of certbot adding some code not really working on local network if you use IP address. Found a working solution to force http into https independent of the url/ip you are using
I replaced the whole section (old one hashed) defining the http server
server {
listen 80;
server_name _;
rewrite ^ https://$host$request_uri? permanent;
}
#server {
# if ($host = my.ddns.com) {
# return 301 https://$host$request_uri;
# } # managed by Certbot
#
#
#
# listen 80 default_server;
# listen [::]:80 default_server;
#
# server_name my.ddns.com;
# return 404; # managed by Certbot
#
#
#}