shaarli / Shaarli

The personal, minimalist, super-fast, database free, bookmarking service - community repo
https://shaarli.readthedocs.io/
Other
3.35k stars 290 forks source link

When trying to install Shaarli by accessing the domain name, a 404 error occurred. #2092

Open thetiny99 opened 3 days ago

thetiny99 commented 3 days ago

Hello, I uploaded the complete installation package(shaarli-v0.13.0-full) to the server, but when I tried to install Shaarli using the domain name, I encountered a 404 error, which is very confusing.

After accessing the domain name, I noticed that the address bar redirected to mydomain.com/install, but displayed a 404 Not Found error from nginx. I searched almost the entire internet and couldn't find a similar case to mine. Could you please provide some assistance? Thank you.

I used the AMH server panel for installation, which is quite popular and comes pre-configured with the server environment. I have already set up the permissions as per the official documentation.

20240705163759

nodiscc commented 3 days ago

Hi, your web server needs to be configured as described in https://shaarli.readthedocs.io/en/master/Server-configuration.html#nginx. When nginx is used, notably the fastcgi_split_path_info must be set correctly for URL rewriting to work.

Please paste your web server/virtualhost configuration (and/or ensure all necessary configuration directives are set).

thetiny99 commented 1 day ago

Hi, your web server needs to be configured as described in https://shaarli.readthedocs.io/en/master/Server-configuration.html#nginx. When nginx is used, notably the fastcgi_split_path_info must be set correctly for URL rewriting to work.

Please paste your web server/virtualhost configuration (and/or ensure all necessary configuration directives are set).

Hi, thanks for your reply and answer.

I have now re-installed using docker, which is very fast!

However, now that the website is running successfully, a new problem has arisen, although I followed the official documentation step by step without missing any steps. However, I found that when I visit my domain name https://mydomain.com, the website can be opened normally, but when I visit https://www.mydomain.com, it cannot be opened, and the browser prompts ERR_TOO_MANY_REDIRECTS.

To solve this problem, I tried the following operations, but none of them worked:

  1. Open the /root/shaarli/.nev file and check the domain name configuration. It seems that there is no problem. The host name is only configured with mydomain.com
  2. Edit the label of the shaarli_shaarli_1 container directly in the portainer panel and confirm that the values ​​of traefik.domain and traefik.frontend.rule are only mydomain.com instead of www.mydomain.com
  3. Check the domain name resolution record and confirm that only two A records (www and @) are configured, and there are no redundant records.
  4. Confirm that nginix is ​​not installed to rule out conflicts in this regard.
  5. Confirm that the cookies of the local browser have been deleted, and multiple browsers and networks have been changed.
  6. Try to restart the entire server, restart [shaarli_shaarli_1] and shaarli_traefik_1 containers.
  7. Confirm that /root/.nev is empty, and only /root/shaarli/.nev is configured

None of the above attempts solves the problem that www.mydomain.com cannot be accessed. The browser still prompts ERR_TOO_MANY_REDIRECTS.

This makes me very confused. I hope the official can give some help. Thank you!

Attached is the content of the /root/shaarli/.nev file: SHAARLI_VIRTUAL_HOST=mydomain.com SHAARLI_LETSENCRYPT_EMAIL=admin@mydomain.com SHAARLI_DOCKER_TAG=latest