それをロードする私は、次のnginxのtry_filesダウンロードのphpファイルの代わりに、
x.com opens index.php in/
x.com/example opens example.php in/
x.com/example/ opens example.php in/
x.com/foo/example opens example.php in /foo/
を達成するために、私のnginxのサーバーをセットアップしようとしている私は、このセットアップでは、次のような構成
server {
listen www.delibr.com:443 default_server; # if this is not a default server, remove "default_server"
root /var/delibr.se;
index index.php index.html index.htm; # this is also irrelevant
server_name www.delibr.com;
ssl_certificate /path to/crt;
ssl_certificate_key /path to/key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
location /beta {
return 302 /#signup-form;
}
location/{
try_files $uri $uri.php $uri/;
if ($host != 'www.delibr.com') {
rewrite ^https://www.delibr.com$request_uri? permanent;
}
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
を持っています/ example example.phpと/ example /をダウンロードすると、500 Internal Serverエラーが発生します。誰でも助けてくれますか?
ありがとうございました!ほとんど働いた。しかし、 'x.com/example/はexample.phpを/で開きます。' 'No input file specified 'が生成されます。 – fbonawiede
はい、私は何かを素早くチェックさせてもらえますか? –
私は '書き換え^ /($ 1 $)$/$ 1パーマネント 'を追加しようとしましたが、それは解決しますが新しい問題が発生します。実際にindex.htmlを持つサブフォルダは機能しません。 – fbonawiede