## 500 Internal Server Error 如果文件名中前后有t的可能会出错 ,会出现转义
```
版本:phpstudy 2018
报错:500 Internal Server Error
解决办法:找到nginx的配置文件,改正路径就行
// 错误 \
root "C:\Users\xxx\Desktop\test\public";
// 正确 将路径改为正斜杠
root "C:/Users/xxx/Desktop/test/public";
```
## 修改完后可能会报404错误 那么需要在配置虚拟主机中加上
```
//添加的代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
//完整实例 详见:https://www.kancloud.cn/manual/thinkphp5\_1/353955
server {
listen 80;
server_name test.cn ;
root "C:/Users/xxx/Desktop/test/public";
location / {
index index.html index.htm index.php;
#autoindex on;
#添加的
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
#添加的
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
```