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-08-21 09:10:11

cristianoss
Member
Registered: 2024-08-21
Posts: 2

[Solved] Has anyone had success installing at site.com/subdir in NGINX

I'm trying to install NGINX in a folder on the main website, for example /support.
Could someone who has succeeded provide an example of their configuration?

Thanks

Last edited by cristianoss (2024-08-21 18:31:10)

Offline

#2 2024-08-21 18:44:07

cristianoss
Member
Registered: 2024-08-21
Posts: 2

Re: [Solved] Has anyone had success installing at site.com/subdir in NGINX

The only way I found was to run Apache2 on 127.0.0.1:8080 and NGINX doing Proxy.

In Apache2:
-------------

<VirtualHost *:8080>

   ServerName localhost

   DocumentRoot /usr/share/nginx/www/html
   Alias "/glpi" "/usr/share/nginx/www/glpi/public"

   <Directory /usr/share/nginx/www/glpi/public>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
       RewriteEngine On
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php [QSA,L]
   </Directory>

</VirtualHost>

Important:
In /etc/apache2/ports.conf
Listen 127.0.0.1:8080


In NGINX:
-----------

upstream glpi {
  server 127.0.0.1:8080;
}
server {

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

    location  ~ ^/glpi {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://glpi;
    }
}

If anyone has another tested solution or a suggestion, post it here.

Offline

Board footer

Powered by FluxBB