server {
server_name mediaserver.localdomain;
listen 80;
index index.php index.htm index.html;
root /var/www/html/Organizr;
location =/{
root /var/www/html/Organizr;
}
location /homelab {
alias /opt/homelab/;
}
location ~ /\.git {
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
include snippets/fastcgi-php.com; =nginx設定の問題(ルート/エイリアス)
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
これは私の設定であり、私の人生にとってはうまく動作しません。
私の期待は、HTTPを持っていることです://はmediaserver.localdomain/"/var/www/html/Organizr/index.php" に
に行くと私は、httpに行くとき:// MediaServerの.localdomain/homelabは/それは "/opt/homelab/index.php"
しかし、唯一のhttpを引っ張る:// mediaserver.localdomain /作品ではない/ homelab /私はGoogleの管理技術を使い果たしてしまった
エイリアスとルート定義に関するnginxのドキュメントページ。ありがとうございます。 FYI
(私は自動リンクを取り除くために、意図的にリンクにスペースを入れる)
ありがとうございました。 try_filesは複製されています。スニペットには次のようなものがあります。#PHPスクリプトが存在することを確認してから渡してください。 try_files $ fastcgi_script_name = 404; – Loopback
try_filesを削除すると、すべてが広告として機能します。大きな説明に感謝します! – Loopback