You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-03-12 12:27:26

pgtecmed
Member
Registered: 2024-03-12
Posts: 2

glpi nginx issue

I recently installed GLPI using Nginx as the web server. Initially, I configured the web server root directory as follows:

root /var/www/.../glpi;

Upon this configuration, I received a security warning indicating that the web server root directory configuration is not safe as it permits access to non-public files. The message advised checking the installation documentation for securing the root directory.

Following this advice, I attempted to secure the installation by modifying the root directory configuration to:


root /var/www/.../glpi/public;

However, after making this change, I encountered a new issue where Nginx returns a 404 error message for any request to the GLPI installation. This error suggests that the server can no longer locate the GLPI files under the new directory path.

Could you please provide guidance on the following points:

How to properly secure the web server root directory without compromising access to the GLPI installation?
Any specific configuration changes needed to resolve the 404 error after adjusting the root directory to the /glpi/public path?
I have checked the GLPI and Nginx documentation but have not found a clear solution to these issues. Your expertise and any detailed instructions or recommendations would be greatly appreciated to help me resolve this and secure our GLPI installation.

Thank you in advance for your assistance.

Offline

#2 2024-03-12 16:16:09

mmoral
Member
Registered: 2023-12-28
Posts: 50

Re: glpi nginx issue

Hello

I have the next config in my nginx.


server {
    listen 80;
    listen [::]:80;

    server_name myservername;

    root /var/www/glpi/public;

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

    location ~ ^/index\.php$ {
        # the following line needs to be adapted, as it changes depending on OS distributions and PHP versions
        fastcgi_pass unix:/run/php/php-fpm.sock;

        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}


The user and group owner of the dir and subdirs /var/www is www-data?

Can you check the next log files:
/var/log/nginx/error.log
/var/log/nginx/access.log

Last edited by mmoral (2024-03-12 16:17:36)

Offline

#3 2024-03-12 19:21:54

pgtecmed
Member
Registered: 2024-03-12
Posts: 2

Re: glpi nginx issue

Thanks!
Solve the issue.

Offline

Board footer

Powered by FluxBB