修改配置文件,配置虚拟主机
修改配置文件,配置虚拟主机
nginx 安装后,配置文件的默认路径是:
/etc/nginx/conf.d
添加配置文件:
# the nginx server instance server { listen 0.0.0.0:80; server_name domain.com www.domain.com; access_log /home/log/domain/nginx.log; # pass the request to the node.js server with the correct headers and much more can be added, see nginx config options location / { 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; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:8888/; proxy_redirect off; } }