启动:start nginx.exe
重启:nginx.exe -s reload
查看nginx进程:tasklist /fi "imagename eq nginx.exe"
退出:nginx.exe -s quit
nginx config配置文件
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 289;
server_name localhost;
client_max_body_size 200m;
location /mes-system/ {
proxy_pass http://localhost:4200/;
}
location / {
proxy_pass http://localhost:4201/;
}
# Mess Business 后台服务
location /api/ {
proxy_pass http://124.70.162.162:289/api/;
}
# Mess Business 后台服务兼容旧框架
location /mes-system/api/ {
proxy_pass http://124.70.162.162:289/api/;
}
# Sti报表DB数据源适配器
location /data-adapter/ {
proxy_pass http://124.70.162.162:289/data-adapter/ ;
proxy_set_header Host $host:$server_port;
proxy_send_timeout 180;
proxy_read_timeout 300;
keepalive_timeout 300;
proxy_http_version 1.1;
}
location /mes-system/dmp/ {
proxy_pass http://localhost:9905/dmp/;
}
location /dmp/ {
proxy_pass http://localhost:9905/dmp/;
}
# 登录页选择
location /login {
proxy_pass http://localhost:4200/;
}
location /login/api/ {
proxy_pass http://124.70.162.162:289/api/; # 混合
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; #获取客户端真实IP
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_send_timeout 180;
proxy_read_timeout 300;
keepalive_timeout 300;
proxy_http_version 1.1;
}
}
}