Nginx redirect failure for icingaweb2

Solution 1:

I fix it putting a rewrite on the second location.

location ~ ^/(.*)? {
 alias /usr/share/icingaweb2/public;
 index index.php;
 rewrite ^/$ /dashboard;
 try_files $1 $uri $uri/ /index.php$is_args$args;
}

It doesn't feel like the best... but now all is working as expected.

Solution 2:

Just as an addition for anyone who is still facing this problem:

An additional / at the index attribute solves this.

location ~ ^/icingaweb2(.+)? {
  alias /usr/share/icingaweb2/public;
  index /index.php;
  try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args;
}

Happy 2020