nginx安装
Nginx安装教程(windows)_*猪耳朵*的博客-CSDN博客_windows安装nginx
启动脚本startup.bat(新建txt后另存,放到nginx.exe同一级)或者直接点击nginx.exe
脚本内容:
@echo off
rem 如果启动前已经启动nginx并记录下pid文件,会kill指定进程
nginx.exe -s stop
taskkill /f /t /im nginx.exe
rem 测试配置文件语法正确性
nginx.exe -t -c conf/nginx.conf
rem 显示版本信息
nginx.exe -v
rem 按照指定配置去启动nginx
nginx.exe -c conf/nginx.conf
pause
nginx启动失败
错题集锦——nginx启动失败_年少7的博客-CSDN博客_nginx启动失败
这个文章也简单看一下:
Nginx安装教程(windows)_*猪耳朵*的博客-CSDN博客_windows安装nginx
目的:
通过域名A,直接访问hexo生成的本地网站B。
A 比如域名:www.abc.com
B hexo本地访问:http://localhost:4000/
1 本地host修改
2 nginx配置:
listen 80;
server_name abc.com;
#server_name localhost;
location / {
proxy_pass http://localhost:4000;
root html;
index index.html index.htm;
}
Q:推荐必有用80端口,如果采用其余端口比如8080端口,那么访问的时候格式必须是:abc.com/8080。这个8080好像是无法隐藏的。
80端口是默认的,所以系统会处理直接隐藏,访问abc.com其实就是访问abc.com/80
80端口被占用启动nginx启动失败:
windows下启动nginx闪退--80端口被System占用解决办法_菜鸟驿站2020的博客-CSDN博客_nginx80端口被占用