Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: "This page does not exist" rewrite loop after installation (Debian 12/nginx/PHP 8.x) #2539

Closed
YoSiJo opened this issue May 20, 2024 · 3 comments

Comments

@YoSiJo
Copy link

YoSiJo commented May 20, 2024

Installation

apt install \
  nginx \
  certbot python3-certbot-nginx \
  php php-fpm php-sqlite3 php-gd php-intl php-mbstring \
  unzip sudo wget

mkdir /var/www/grocy &&
cd /var/www/grocy

wget https://releases.grocy.info/latest &&
unzip latest &&
chown --recursive www-data: .

sudo --user=www-data cp config-dist.php data/config.php

Then: vim data/config.php

Setting('BASE_PATH', '');
…
Setting('BASE_URL', '/');
…

Now edit the default nginx config and only replace the server_name for the ACME Chalange: vim /etc/nginx/sites-enabled/default

server_name grocy.example.com;
…

Run certbot and get a Cert with config changes for nginx.
Alter this we reedit the nginx default config for grocy: vim /etc/nginx/sites-enabled/default

server {
    server_name grocy.example.com;

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/grocy.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/grocy.example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    root /var/www/grocy/public;

    location / {
        try_files $uri /index.php$is_args$query_string;

        location ~* \.(php|inc)$ {
            include fastcgi.conf;

            fastcgi_pass unix:/run/php/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_intercept_errors on;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }
    }
}
server {
    if ($host = grocy.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen [::]:80 default_server;

    server_name grocy.example.com;
    return 404; # managed by Certbot
}

nginx -t && nginx -s reload

When you now open the Site https://grocy.example.com you see the message This page does not exist and after 5 Sec, you are rewrite to https://grocy.example.com and again and again…

Context

Of course I can see the connection to the issue #1404 and therefore know that I should go to the SubReddit; But I openly admit that I am not willing to create an account on Reddit and there is also a discussion function on Github.

In addition, I have already tested many variants of the VHost Config and also tested several variations of BASE_PATH and BASE_URL; however, the error pattern has never changed.
Therefore I think it is also possible that there is a problem with the IPv6 only stack.
However, I could not find a logging function or anything like that in the configuration, so I don't know how I could debug this further.

@berrnd
Copy link
Member

berrnd commented May 20, 2024

This is clearly a configuration issue and not a reproducible Grocy Bug, but this here is the tracker for such reproducible Bugs and Feature Requests and not your personal setup problems (README ref).

I also use a NGINX / PHP-FPM stack for Grocy and all of it's demo instances, serving daily more page views any private instance will see per year or so and it works more than fine - also leads to this can't be a bug in Grocy itself. Why not simply compare your stuff with the reference config I've published for everyone some time ago.

 

Of course I can see the connection to the issue #1404 and therefore know that I should go to the SubReddit

I openly admit that I find it frustrating that you're deliberately abusing this issue tracker and essentially wasting my time on a public holiday day by that, thank you.

@berrnd berrnd closed this as completed May 20, 2024
@YoSiJo

This comment has been minimized.

@berrnd

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants