温馨提示×

windows下nginx如何搭建网站

小新
547
2020-12-07 15:04:19
栏目: 云计算

windows下nginx如何搭建网站

windows下nginx搭建网站的方法:

1.打开nginx安装目录,找到“nginx.conf”配置文件。

2.把本机的80端口的访问请求转到我们自己的网站主页上,配置如:

server {

listen  80;

server_ name  localhost;

#charset koi8-r:

access_ 1og 1ogs/host.access.1og main;

location / {

root  D:/MyWebApps/;   //改成nginx根目录

index index.html index.htm;

]

3.在nginx.exe文件的目录下打开cmd命令窗口,执行命令:

nginx.exe -s reload

4.把准备好的网站程序放进nginx根目录即可。

0