1. 程式人生 > >nginx 反向代理和對映

nginx 反向代理和對映

反向代理同事hosts也需要配置

server
{
listen 80;
server_name localhost;
location /centos {
proxy_pass http://mirrors.163.com/centos/;
}
}

 

埠對映

最外層

#user nobody;
worker_processes 1;

error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

stream{ proxy_timeout 30m;

server{

listen 1521;

proxy_pass 192.168.1.30:1521; }

參考

https://blog.csdn.net/qq_31226223/article/details/78766314