iTop and NGINX

Convert Apache's configuration

You will have to manually convert the .htaccess present in the iTop source code to Nginx's configuration.

Please note that after each upgrade, you should check if new rules were introduced. The simplest way is to compare file changes using github (example)

Portal

If you are running iTop on NGINX and choosed the enhanced portal, you are most likely to encounter a 404 error on some portal pages.

By default when accessing an url like : http://localhost/dir/script.php/arg1/arg2 NGINX thinks that script.php is a directory and tries to execute the index file located at /dir/script.php/arg1/arg2 (which doesn't exists).

In iTop this means that when NGINX is trying to execute http://localhost/pages/exec.php/browse/faq?exec_module=itop-portal.php&exec_page=index.php NGINX actually tries to execute /pages/exec.php/browse/faq which is not a real script.

You need to configure your NGINX server properly so it can serve those urls correctly.

The enhanced portal is based on the Symfony framework which provides a documentation about this configuration. You can adapt it to your instance. Just keep in mind that the portal uses /pages/exec.php instead of /index.php.

One of our community user used this configuration on his NGINX instance to make the portal work. As we have NOT tested it, we can't say for sure that it is working but this could be of some help :
location / {
    try_files $uri $uri/ =404;
}

location ~ ^(.+.\.php)(/|$) {
    fastcgi_pass    unix:/var/run/php7.2-fpm.sock;  #For Debian, depends on distributive
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
latest/install/nginx.txt ยท Last modified: 2024/09/10 10:25 (external edit)
Back to top
Contact us