环境说明:centos7
安装版本:tengine2.2.2
实现目的:
想用本地80端口,代理其它服务器的非80端口,实现80端口复用
[root@tiaobanji conf]# cat nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name wiki.com;
location / {
proxy_pass http://172.16.188.207:8090;
}
}
}
server下的结点:
listen:监听80端口
server_name:转发到哪个地址
proxy_pass:代理到哪个地址
nginx常用命令(要进入到nginx的目录):
开启:start nginx
重启:nginx -s reload