首先下载个nginx
nginx的命令行
启动nginx
start nginx
停止
nginx.exe -s stop (强制停止)
或
nginx.exe -s quit
重新载入
nginx.exe -s reload
配置nginx
比如说一个localhost:8080端口
想让localhost:80进行访问
可以对nginx.conf文件进行配置
server {
listen 80;
#要代理的域名
server_name manage.leyou.com;
location / {
#root html;
#index index.html index.htm;
proxy_pass http://127.0.0.1:8080;
proxy_redirect default;
}
}
启动nginx就可以访问了通过80端口进行访问8080端口了
可以代理多个端口