Nginx服务器,在window系统中的使用(前端,nginx的应用)

 简介:Nginx是一个轻量级、高性能的HTTP和反向代理web服务器,且支持电子邮件(IMAP/POP3)代理服务,特点是占用内存少,并发能力强,给我们来了很多的便利,国内大部分网站都有使用nginx(Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点开发)。

Nginx在window系统中的使用,及注意事项:

1、想要在电脑上使用nginx代理,首先需要下载nginx应用,这里下载;

nginx官网http://nginx.org/en/download.html

2、下载、解压完成后,直接在\nginx-1.24.0\html文件目录下存放你打包好的前端文件就行,最后在\nginx-1.24.0\conf\nginx.conf文件中配置代理,如下图,配置完成后通过localhost就可以访问部署的应用;

 3、重新启动nginx应用时,然后需要在dos窗口操作,执行相关命令(需要在nginx文件目录下执行命令才可以),最后配置域名就可使用;

//杀掉nginx进程(结束nginx应用)
taskkill /f /t /im nginx.exe//启动Nginx应用(或者可以直接双击exe文件启动)
start nginx

4、nginx常用,相关命令:

//启动Nginx:
start nginx   //杀掉进程(尤其是修改nginx.conf文件后,加载不了修改之后的配置文件):
taskkill /f /t /im nginx.exe//杀死所有nginx进程:
killall nginx//重启Nginx:
nginx -s reopen//重新加载Nginx配置文件,然后以优雅的方式重启Nginx:
nginx -s reload//强制停止Nginx服务:
nginx -s stop//优雅地停止Nginx服务(即处理完所有请求后再停止服务):
nginx -s quit //检测配置文件是否有语法错误,然后退出:
nginx -t //打开帮助信息:
nginx -h //显示版本信息并退出:
nginx -v //显示版本和配置选项信息,然后退出:
nginx -V //检测配置文件是否有语法错误,然后退出:
nginx -t //检测配置文件是否有语法错误,转储并退出:
nginx -T //在检测配置文件期间屏蔽非错误信息:
nginx -q //设置前缀路径(默认是:/usr/share/nginx/):
nginx -p prefix //设置配置文件(默认是:/etc/nginx/nginx.conf):
nginx -c filename //设置配置文件外的全局指令:
nginx -g directives

dos执行nginx -h命令后,这里出现操作命令的介绍:

Options:-?,-h         : this help-v            : show version and exit-V            : show version and configure options then exit-t            : test configuration and exit-T            : test configuration, dump it and exit-q            : suppress non-error messages during configuration testing-s signal     : send signal to a master process: stop, quit, reopen, reload-p prefix     : set prefix path (default: NONE)-e filename   : set error log file (default: logs/error.log)-c filename   : set configuration file (default: conf/nginx.conf)-g directives : set global directives out of configuration file翻译后:选项:-?-h:这有帮助-v:显示版本并退出-V:显示版本和配置选项,然后退出-t:测试配置并退出-T:测试配置,转储并退出-q:在配置测试时禁止非错误消息-s signal:向主进程发送信号:停止,退出,重新打开,重新加载-p prefix:设置前缀路径(默认:NONE)-e filename:设置错误日志文件(默认:logs/error.log)-c filename:设置配置文件(默认:conf/nginx.conf)-g directives:将全局指令从配置文件中删除

先分享到这,持续更新(边学边更)......

本文链接:https://my.lmcjl.com/post/13593.html

展开阅读全文

4 评论

留下您的评论.