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;

 

posted @ 2021-10-19 13:40  ꧁执笔小白꧂  阅读(390)  评论(0编辑  收藏  举报