CachetHQを特定の場所にあるnginx + php-fpmで提供しようとしています。ドキュメントは(これが動作)status.example.com
に役立つ例として、これを与える:Nginxから別の場所にアプリケーションをホストする
server {
listen 80;
server_name status.example.com;
root /var/www/Cachet/public;
index index.php;
location/{
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_keep_conn on;
}
}
しかし、代わりstatus.example.com
になると、私はexample.com/status
で配信したいと思います。
私は、これがうまくいくことを期待していたが、error.logファイルから、私はそれが/etc/nginx/htmlindex.php
をしようとしている見るが、それは/mnt/data/site/www-cachet/public/index.php
次のようになります。
location /status/ {
index index.php;
root /mnt/data/site/www-cachet/public;
try_files $uri index.php$is_args$args;
location ~ ^/status/.+\.php$ {
root /mnt/data/site/www-cachet/public;
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_keep_conn on;
}
}
優先権は正しくありません。それは最初に 'location /'と一致します – zywj
@ZYWJよく 'location /'は '/ status'にあることができないので問題にならないはずです – rodorgas
@rodorgas、私の答えはあなたのために正しく動作しますか? – cnst