由于百度到的教程太复杂,就简单地代理个网页都一堆代码,其实无必要,因此记录下最简单的配置方式
...
省略,默认的就好
...
http {
...
省略,默认的就好
...
server {
listen 8999;
server_name localhost;
location / {
root /Users/xiaoming/test; # 被代理的目录
index index.html index.htm; # 默认访问的文件
}
}
}
# 以上配置将会访问本地的目录'/Users/xiaoming/test',如果该目录下有index.html,则默认打开index.html
# 浏览器输入http://localhost:8999,即可!



