1、安装window版的nginx
将nginx-1.12.0.zip解压到开发目录中
如:E:\development\nginx-1.12.0-guli-api
双击nginx.exe运行nginx
访问:localhost
2、配置nginx代理
在Nginx中配置对应的微服务服务器地址即可
server { listen 9001; server_name localhost; location ~ /eduservice/ { proxy_pass http://localhost:8001; } location ~ /eduoss/ { proxy_pass http://localhost:8002; } location ~ /eduvod/ { proxy_pass http://localhost:8003; } location ~ /cmsservice/ { proxy_pass http://localhost:8004; } location ~ /ucenterservice/ { proxy_pass http://localhost:8150; } }
3、重启nginx
nginx.exe -s reload