server {
  listen *:8080;
  server_name icinga.actcur.com;

  root /usr/share/webapps/icingaweb2/public; #Path of icinga2 web directory
  index index.php;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;

  location = /favicon.ico {
    log_not_found off;
    access_log off;
    expires max;
  }

  location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
  }

  location ~ \..*/.*\.php$ {
    return 403;
  }

  if (!-d $request_filename) {
    rewrite ^/(.+)/$ /$1 permanent;
  }

  location / {
    try_files $1 $uri $uri/ /index.php$is_args$args;
  }

  location ~ ^/index\.php(.*)$ {
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; #Replace with the port if php fpm is configured to run on port.
    fastcgi_param SCRIPT_FILENAME /usr/share/webapps/icingaweb2/public/index.php; #Replace with icinga2 web index.php file path.
    fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2;
    fastcgi_param REMOTE_USER $remote_user;
  }
}