1. 在 nginx.conf 文件中引用 conf.d 下的所有配置文件

#在http配置节的末尾添加配置引用
http {
    ...

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

2. 在 conf.d 中添加 default.conf 配置文件

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }
    
    #代理配置
    location /business {
        proxy_pass  http://business.app.com;
    }
    
    #代理配置
    location /user {
        proxy_pass  http://user.app.com;
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
猜你喜欢
  • 2021-11-23
  • 2021-07-26
  • 2021-12-12
  • 2021-09-08
  • 2021-12-22
  • 2021-08-05
相关资源
相似解决方案