Nginx-Server常规配置

1.cd /.../.../nginx/conf/(例如/usr/local/nginx/conf/)文件夹,新建*.conf(如net12.conf)

server {
  listen 888;
  server_name localhost;
  root /root/FirstApi/;
  index index.html index.htm;

  location / {
    proxy_pass http://localhost:5000;
  }
}

 2.编辑nginx.conf配置文件(vi nginx.conf)。

  在http{}里最后一行加上刚才创建的目录地址。(注意是在http{}里)

  include /usr/local/nginx/conf/vhost/*.conf;

365个夜晚,我希望做到两天更一篇博客。加油,小白!
原文地址:https://www.cnblogs.com/qq2806933146xiaobai/p/15424379.html