随笔分类 - Nginx
摘要:# 共同点: 指定文件路径。 # 不同点: root解析时包含location后面的url; alias解析时location不包含后面的url; 下面举例说明 root 和 alias 的实现方式: 假设我们需要访问的文件路径是 192.168.206.213/home/fileTest/123.
阅读全文
摘要:第一种: 直接加个location块 location /rabbitmq/ { proxy_pass http://127.0.0.1:15672/; } 第二种: location /rabbitmq/ { port_in_redirect on; proxy_redirect off; pro
阅读全文
摘要:问题: 我的nginx.conf配置文件中的server_name是这样子的,然后无法访问。 但是如果说server_name后面改成服务器的IP地址却是可以访问的。 解决方案: 在本机上(不是服务器)找到并修改C:\Windows\System32\drivers\etc\host这个文件 加上(
阅读全文
摘要:新建文本文件NginxRun.bat。(名字无所谓,后缀名得是bat) 将以下代码复制到bat文件中即可。 @echo off ::进入D盘 d: ::进入nginx目录 这里是自己的nginx目录 cd D:\nginx-1.12.2 chcp 65001 color 0e :menu ECHO.
阅读全文
摘要:在nginx.exe目录,打开命令行工具,用命令 启动/关闭/重启nginx nginx -t //默认检测nginx.conf 配置文件 nginx -v //查看nginx版本 start nginx //启动nginx nginx -s stop //停止nginx nginx -s quit
阅读全文
摘要:出现这个问题是因为80端口被占用了 1、cmd输入命令netstat -aon|findstr “80” 2.、查看80端口 16356对应的任务 输入命令 tasklist|findstr "16356" 3、结束掉16356的任务 4、启动nginx 浏览器输入localhost
阅读全文