window下phpstudy的nginx配置虚拟主机和伪静态

在其他选项文件菜单中->打开配置文件->选择vhosts-ini

window下phpstudy的nginx配置虚拟主机和伪静态文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

nginx服务器配置方法(修改完记得重启服务器后)文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

1、直接将此代码复制进vhosts-ini,即可使用(每复制一个相当于新建一个虚拟主机)文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

server {
listen 80;
server_name www.xixi.com; #填你:第2步dns解析,配置的虚拟域名
root "D:/phpStudy/WWW/wx_mall/public"; #填你:网站所在目录
location / {
index index.html index.htm index.php;
autoindex on;
# 伪静态配置
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
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;
fastcgi_param TP_ENV sixian;
}
}文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

2、DNS解析了:在C:\Windows\System32\drivers\etc下打开hosts
加入你配置的域名解析到本地的代码 例如:文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

 文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html 文章源自:https://www.tuzier.com/生活小百科-https://www.tuzier.com/life/51.html

 
  • 本站文章来自网友投稿、本站原创以及互联网统一发布,部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考。转载请务必保留本文链接:https://www.tuzier.com/life/51.html