nginx for Windows
配置nginx.conf
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:
-- 运行tasklist查看nginx进程的命令 tasklist /fi "imagename eq nginx.exe" -- 按名称终止进程 taskkill /f /im nginx.exe 启动: cd /d D:\soft\nginx-1.14.2 nginx.exe
访问:
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/
创建资源:
