我现在的需求是这样的:内网的客户端A通过访问服务器B来访问外网,现在在服务器B使用nginx做反向代理,期望在客户端A使用浏览器输入192.168.0.2/baidu就能够访问百度,并且所有的请求都走服务器B,客户端A是没有通外网的。
我的nginx配置如下:
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 localhost;
location /baidu {
proxy_pass https://www.baidu.com;
}
}
}