Nginx プレフィックス/サブディレクトリ

Nginx プレフィックス/サブディレクトリ

何が起こっているかというと、GLPI プロジェクトがファイル (js、css、php など) を読み込んでいないのです。

ローカル URL は ですhttp://localhost/glpi-grupo/が、Elements 内のすべてのファイルが/glpi-grupo次のように欠落しています。http://localhost/style.css

ここに画像の説明を入力してください

サブディレクトリを強制的にロードする必要がある/glpi-grupo

私は Nginx と Traefik をすべて Docker コンテナ内で使用しています。

私のトラエフィックルール:

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

私のNginx設定:

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;
    }
}

関連情報