Hello, my dears,
i installed FreePBX Utility 16.0.40.4. If I try to access the admin website via the URL: “freepbx.intern.example.de” then I do not end up on the admin web interface. Only if I call the following URL: “freepbx.intern.example.de/admin”. Where can that be? I use the following configurations:
root@dsme01:~# cat /etc/nginx/sites-available/freepbx.conf
server {
server_name freepbx.intern.example.com;
listen freepbx.intern.example.com:80;
return 301 https://$host$request_uri;
}
server {
ssl_certificate /etc/ssl/certs/freepbx.intern.example.com.crt;
ssl_certificate_key /etc/ssl/private/freepbx.intern.example.com.key;
ssl_dhparam /etc/ssl/certs/dhparams.pem;
listen freepbx.intern.example.com:443 ssl default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html index.php config.php;
server_name freepbx.intern.example.com; # don't use _ or FreePBX may complain about referer
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf; # server defaults are good
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param HTACCESS on; # disables FreePBX htaccess warning
}
# disallows the things that the FreePBX .htaccess files disallow
location ~ (/\.ht|/\.git|\.ini$|/libraries|/helpers|/i18n|/node|/views/.+php$) {
deny all;
}
# from the api module .htaccess file
rewrite ^/admin/api/([^/]*)/([^/]*)/?(.*)?$ /admin/api/api.php?module=$1&command=$2&route=$3 last;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
root@dsme01:~# cat /var/www/html/index.php
<?php
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2013 Schmooze Com Inc.
//
if (file_exists(dirname(__FILE__) . '/index_custom.php')) {
include_once(dirname(__FILE__) . '/index_custom.php');
} else {
$basename = pathinfo($_SERVER['PHP_SELF'],PATHINFO_DIRNAME);
$uri = (!empty($basename) && $basename != '/') ? $basename . '/admin' : '/admin';
header('Location: '.$uri);
}
root@dsme01:~# ls -la /var/www/html/
insgesamt 92
drwxr-xr-x 16 root root 4096 19. Jul 14:52 .
drwxr-xr-x 7 root root 4096 19. Mai 12:14 ..
drwxr-xr-x 10 asterisk asterisk 4096 19. Jul 14:53 admin
drwxr-xr-x 7 root root 4096 5. Mai 11:11 bareos-webui
-rw-r--r-- 1 root root 767 1. Feb 2020 dateiupload.php
drwxr-xr-x 9 root root 4096 8. Okt 2019 elasticsearch-head
-rw-r--r-- 1 root root 16 23. Mai 03:32 .htaccess
-rw-r--r-- 1 root root 53 16. Dez 2022 .htpasswd
-rw-r--r-- 1 root root 251 1. Feb 2020 index.html
-rw-r--r-- 1 root root 612 16. Dez 2022 index.nginx-debian.html
-rw-r--r-- 1 root root 453 23. Mai 03:32 index.php
drwxr-xr-x 9 root root 4096 24. Mai 13:01 ldap-account-manager
drwxr-xr-x 2 root root 4096 16. Dez 2022 letsencrypt
drwxr-xr-x 15 www-data www-data 4096 2. Mai 22:55 nextcloud
drwxr-xr-x 12 root root 4096 18. Dez 2022 phpldapadmin
drwxr-xr-x 12 root root 4096 16. Jan 2019 phpLDAPadmin
drwxr-xr-x 13 root root 4096 19. Mai 19:02 phpmyadmin
drwxr-xr-x 12 root root 4096 23. Mär 2021 powerdns-admin
-rw-r--r-- 1 root root 361 23. Mai 03:32 robots.txt
drwxr-xr-x 13 www-data www-data 4096 15. Mai 2021 roundcube
lrwxrwxrwx 1 root root 38 19. Mai 14:02 ucp -> /var/www/html/admin/modules/ucp/htdocs
drwxr-xr-x 2 root root 4096 16. Jul 12:15 upload
drwxr-xr-x 13 www-data www-data 4096 21. Sep 2021 vmailpanel
drwxr-xr-x 13 root root 4096 21. Sep 2021 vMailpanel
Do you have a tip where the error is?
Greetings from Stefan Harbich