Giter Club home page Giter Club logo

Comments (6)

bohwaz avatar bohwaz commented on September 3, 2024 1

Your config redirects everything ending with .php to FPM. So when you request status.php, FPM is called, it looks for a file named status.php, can't find it, and returns a 404.

You need to set up your config so that non-existing .php URLs are sent to _router.php, like this:

	location ~ \.php {
		try_files $uri $uri/ /_router.php?$query_string;
...

This should be good like that.

from karadav.

trev0r-STA avatar trev0r-STA commented on September 3, 2024

All right
I've made some progress, it was the rewriting rules which are not correct. Now, the webUI is working, but I can't connect a client: Nextcloud, OwnCloud, desktop or mobile app (version tested on the home page of the project), no one will work. When I try to connect, every app say: "404 Not Found" at "GET https://karadav.example.com/status.php"
There is no status.php anywhere... What's wrong with my configuration ?

`
server {
server_name karadav.example.com;

root /usr/local/share/karadav/www;
index index.php;

access_log /var/log/nginx/karadav.access.log;
error_log /var/log/nginx/karadav.error.log;

charset utf-8;

location / {
try_files $uri $uri/ @rewrite;
}

location @rewrite {
if (!-e $request_filename){
rewrite ^(.*)$ /_router.php;
}

location ~ ^(.+.php)(.)$ {
try_files $fastcgi_script_name =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+.php)(.
)$;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/karadav.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/karadav.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

}

server {
if ($host = karadav.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name karadav.example.com;
return 404; # managed by Certbot
}
`
Thanks for your help

from karadav.

trev0r-STA avatar trev0r-STA commented on September 3, 2024

I understand what you mean. But as I'me not an expert with Nginx, where should I put this line of code in my config file. I've tried to placed it just before the fpm part, but with no success :-(

from karadav.

bohwaz avatar bohwaz commented on September 3, 2024

Replace your try_files line in the php block by the one I provided.

from karadav.

bohwaz avatar bohwaz commented on September 3, 2024

I am closing this issue as it is a server configuration issue on your side.

from karadav.

trev0r-STA avatar trev0r-STA commented on September 3, 2024

👍

from karadav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.