配置Nginx反向代理
一、最简单的反向代理脚本
server
{
listen 80;
server_name t.2dan.cc;
location / {
proxy_pass http://twitter.com/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
添加好后,先执行:
/usr/local/nginx/sbin/nginx -t