1. 查看nginx所在位置
$ nginx -t
/etc/nginx/nginx.conf
2. 配置
user nobody; #启动服务的用户 worker_processes 2; error_log logs/error.log; #错误日志 events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; gzip_min_length 1k; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_types text/plain application/x-javascript text/css application/xml; server { listen 80; server_name *.sapphirecastle.win; #域名 root ~/website/SapphireCastle/; location / { index index.html index.htm; proxy_pass http://localhost:3000; #代理端口 } } }