反向代理用的是nginx的proxy_pass功能
location / {
proxy_pass http://baidu.com;
}
这样可以把网站访问的目录转发到其他的网站。(可用于扫描网站目录、制作镜像站等等。。)
完整配置文件:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
#