You are not logged in.
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
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