nginx是什么?
nginx是一款轻量级、高性能的HTTP服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。
nginx的优点:
1、占内存小,可以实现高并发连接,处理响应快;
2、可以实现HTTP服务器、虚拟主机、反向代理、负载均衡;
3、配置简单;
4、可以不暴露真实服务器的ip
nginx的启动与关闭
将nginx压缩包解压后,双击nginx.exe,或者使用命令 start nginx 就启动成功了
验证:http://localhost
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
这里说一下,nginx默认监听80端口
当第一次启动nginx时,输入localhost,访问地址就是http://127.0.0.1:80,页面跳转到上述Welcome to nginx!
响应的页面可以再nginx.conf文件中配置的
server {
listen 80;
server_name localhost;
location / {
root html;
index index2.html index2.htm;
}
}
所以欢迎页面可以自己设置,只要将页面放在静态资源的文件夹html中,并修改index即可。