钩子:
How To Install Nginx on Ubuntu 14.04 LTS
1. sudo vi /etc/nginx/nginx.conf
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
2. sudo vi /etc/nginx/sites-enabled/default
# Make site accessible from http://localhost/
#server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
#try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
3. sudo nginx -t (查看nginx语法,并返回详细错误)
sudo nginx -h (不懂就查)