1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| worker_processes 1;
events { worker_connections 1024; }
http { include mime.types; default_type application/octet-stream;
sendfile on; keepalive_timeout 65; # 配置虚拟主机 192.168.80.144 server { # 监听的端口 listen 80; # 虚拟主机名称这里配置ip地址 server_name 192.168.80.144; # 所有的请求都以 / 开始,所有的请求都可以匹配此 location location / { # 使用 root 指令指定虚拟主机目录即网页存放目录 # 比如访问 http://ip/index.html 将找到 /usr/local/docker/nginx/wwwroot/html80/index.html # 比如访问 http://ip/item/index.html 将找到 /usr/local/docker/nginx/wwwroot/html80/item/index.html
root /usr/share/nginx/wwwroot; # 指定欢迎页面,按从左到右顺序查找 index index.html index.htm; }
} }
|