Score:0

Nginx prefix/subdirectory

cl flag

What is happening is that the GLPI project is not loading the files (js, css, php, etc).

The local URL is http://localhost/glpi-grupo/, but all the files in Elements are missin the /glpi-grupo like this: http://localhost/style.css

enter image description here

I need to force them to load with the subdirectory /glpi-grupo

I'm using Nginx and Traefik, all in a Docker container.

My traefik rule:

traefik.frontend.rule: Host:localhost; PathPrefixStrip:/glpi-grupo

My Nginx config:

server {
    listen 80;
    index index.php index.html;
    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/html;
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_param SERVER_NAME $host;
        fastcgi_index index.php;
        fastcgi_pass glpi-grupo:9000;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}
us flag
You need to fix your application configuration's base URL so that it generates correct URLs.
Otavio Souza Rocha avatar
cl flag
@TeroKilkanen The application it to big. It is a open source project called GLPI
us flag
So have you checked if the application has configuration for this?
Otavio Souza Rocha avatar
cl flag
@TeroKilkanen I had checked, but there is no config variable for this... to make it works, i will need change the entire code.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.