nginx for Windows

配置nginx.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
worker_processes  1;
 
events {
  worker_connections  1024;
}
 
http {
 
  server {
    listen       8092;
    server_name  localhost;
 
    location / {
      root   D:/IdeaProjects/xcProjects/test/RuoYi-Vue/ruoyi-ui/dist;
      try_files $uri $uri/ /index.html;
      index  index.html index.htm;
    }
 
    location /flow {
      root   html;
      index  index.html index.htm;
    }
 
    location /prod-api/ {
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header REMOTE-HOST $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://localhost:8080/;
    }
 
    location /sogou/ {
      rewrite ^/(.*)$ https://www.sogou.com redirect;
    }
 
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
      root   html;
    }
 
  }
 
}

  

停止/启动nginx:
1
2
3
4
5
6
7
8
-- 运行tasklist查看nginx进程的命令
tasklist /fi "imagename eq nginx.exe"
-- 按名称终止进程
taskkill /f /im nginx.exe
 
启动:
cd /d D:\soft\nginx-1.14.2
nginx.exe

  

访问:

1
2
3
4
http://127.0.0.1:8092
http://127.0.0.1:8092/flow/
http://127.0.0.1:8092/prod-api/
http://127.0.0.1:8092/sogou/

   

创建资源:

 

posted @   草木物语  阅读(23)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示