Nginx 在Windows下搭建静态Web服务

Posted 抱影无眠

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx 在Windows下搭建静态Web服务相关的知识,希望对你有一定的参考价值。

简介

nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites including Yandex, Mail.Ru, VK, and Rambler. According to Netcraft, nginx served or proxied 23.76% busiest sites in March 2018. Here are some of the success stories: Dropbox, Netflix, Wordpress.com, FastMail.FM.

 

下载

参考 http://nginx.org/en/download.html

 

安装

直接解压到程序目录。

 

命令

    启动

    $ ngnix

    停止

    $ ngnix –s stop

    $ ngnix –s quit

 

配置

参考部分代码:

server {

listen 8000;

server_name localhost;

 

location / {

root C:/web/aaa;

index index.html index.htm;

}

}

 

server {

listen 8001;

server_name localhost;

 

location / {

root C:/web/bbb;

index index.html index.htm;

}

}

 

 

    

以上是关于Nginx 在Windows下搭建静态Web服务的主要内容,如果未能解决你的问题,请参考以下文章

Windows下Nginx+Web.py+FastCGI服务搭建

使用Nginx搭建静态网站

如何在windows下搭建Nginx+MySQL+PHP环境

【NGINX入门】2.Nginx搭建静态资源web服务器

怎么在linux下搭建一个nginx服务器

nginx静态资源配置(转发)