windows
命令:
查看nginx的版本号:nginx -v
启动nginx:start nginx
快速停止或关闭nginx:nginx -s stop
正常停止或关闭nginx:nginx -s quit
配置文件nginx.conf修改重装载命令:nginx -s reload
访问本地文件夹
server {
listen 8090;
server_name localhost;
#配置跨域
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
#charset koi8-r;
# 解决中文乱码问题
charset gbk,utf8;
#access_log logs/host.access.log main;
location / {
#本地代理的文件夹
root C:\\;
autoindex on;
#root html;
#index index.html index.htm;
}
}
效果图: