0
最近ApacheをNginxに使ったウェブサイトを移動しました。 URLから.PHPを維持しながらhttp://example.com/login.php
を指すようにnginx - phpファイル用のURLを書き換えよう
http://example.com/login
:
は、どのように私はこのようになりますURLを得ることができますか?
私の現在の構成:
server {
listen 80;
listen [::]:80;
root /var/www/example.com/html/;
index index.php index.html;
server_name example.com www.example.com;
location/{
try_files $uri $uri/ =404;
}
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
あなたの答えをいただき、ありがとうございます。私の現在の設定では...どのように動作するのですか?私はしようとしましたが、nginxサーバーは再起動しませんでした。 – Ciprian