Nginx Configuration to escape /login error

72 views
Skip to first unread message

Taylor Farnsworth

unread,
Apr 25, 2023, 2:21:31 PM4/25/23
to AgenDAV general
Hi,

I am attempting to get AgenDAV to run on my Nginx server but everytime I try and access the index.php file it auto adds a /login to the end which causes a 404 Not Found error. I have looked at some other debugging helps and have seen this issue before. The solution in the past has been to go to a link with help configuring the nginx.config to be correct. The only problem is none of those links are working for me. Does anybody know where to get some resources to make it run properly? Thanks in advance if anybody can help.

Thanks,
Taylor

Taylor Farnsworth

unread,
Apr 25, 2023, 6:31:26 PM4/25/23
to AgenDAV general
Ok I figured it out. Here is the code that needs to go in /etc/nginx/sites-available/<Your site>

set $controller /public/index.php;

        location /public {
                root /var/www/html/agendav/web/;
                index index.php;
                try_files $uri $uri/ $controller;

                location ~ ^(?<script>.*\.php)(?<pathinfo>.*)$ {
                         try_files $script $controller;

                        include /etc/nginx/fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                        fastcgi_param PATH_INFO $pathinfo;
                        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
                        fastcgi_param   APPLICATION_ENV  dev;
                }
        }

That got me to the login screen at least. 

Taylor Farnsworth

unread,
Apr 25, 2023, 6:38:00 PM4/25/23
to AgenDAV general
Now I am getting a different error when I try to log in. On Baikal I have created several users and have tried to log into any of them without success. Each time I try I get a "Internal server error"  each time I correctly log in. With incorrect credentials it lets me know they are wrong. This is only when I correctly log in. 

Currently I am connecting with the basic config (I have tried digest as well) and I suspect my base_uri could be the problem. Currently it is "http://localhost/baikal/html/dav.php" (I have also tried it with combinations of cal.php and adding /principals). I have no idea where to go from here because dev mode doesnt seem to be working quite yet. Has anybody seen/fixed this issue?
Reply all
Reply to author
Forward
0 new messages