1.下载nginx
官网:
http:
//nginx.org/en/download.html
直接在服务器上下载 wget
http:
//nginx.org/download/nginx-1.9.12.tar.gz
2.安装
apt-get update
sudo apt-get install nginx
3.配置
cd /etc/nginx/sites-available/
vi default
location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real_IP $remote_addr; proxy_set_header XForwarded-For $proxy_add_x_forwarded_for; proxy_pass http://www.qq.com; }
4.启动
sudo /etc/init.d/nginx reload
5.启动完测试一下网站,可以访问即ok。