Can't make changes from web ui but only from command line

as title, if i use the web ui every checkbox i modify revert to it's previous state as soon as i click save, i can't delete or add whitelist/blocklist entries but everything seems to work through a sudoed command line

i don't use lighttpd as i got nginx as webserver, could be some kind of permission problem?

this is my nginx pihole reverse proxy config

server {
        listen 80;
        listen [::]:80;

        root /var/www/html;
        server_name pihole.aaa;
        autoindex off;

        index pihole/index.php index.php index.html index.htm;

        location / {
			expires max;
            try_files $uri $uri/ =404;
			proxy_pass         http://localhost:80/admin;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header Host $http_host;
			proxy_set_header X-NginX-Proxy true;
			proxy_redirect off;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.2-fpm.sock;
                fastcgi_param FQDN true;
        }

        location /*.js {
                index pihole/index.js;
        }

        location /admin {
                root /var/www/html;
                index index.php index.html index.htm;
        }

        location ~ /\.ht {
                deny all;
        }
}

some other info:

Another anomaly is that the pihole status through web interface is shown as unknown
immagine
but when i run pihole status from terminal it show me as enabled. If i tried to change it through web interface it reset itself soon after

ok maybe i got a clue: probably it's something related to my customization of nginx/php default user, it's not www-data anymore so the next question is: where do i have to change all reference pihole have to it?

update
ok i fixed it by reverting to www-data the php configuration and by reinstalling lighttpd but i don't want that. I mean, i located the problem but now i want to switch to nginx again with a working configuration, how could i?

update2
ok, lighttpd was out of context because i successfully uninstalled it again and it's still working so it's only matter of www-data user coded somewhere in a pihole config file that i need to find

Note that nginx is not a supported configuration at this time.

You need to make sure that the user that PHP is running under (assumed to be www-data) is allowed to run pihole commands with sudo. See /etc/sudoers.d/pihole.

1 Like

yeah i think that this was the last piece of the puzzle, everything seemed like a permission problem but for now i reverted back to www-data user because now i can see it fits more; i wrote everything down if i want to change again in the future.
Thank you mate

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.