12343052 发表于 2018-11-8 10:53:36

nginx 别名配置

  server {
  listen       80;
  server_namewww.etangbo.com etangbo.com; #,就是在server_name后添加访问的别名
  #日志存放路径
  access_log/app/log/www/host.access.log main;
  location / {
  root   /data/www;
  indexindex.html index.htm;
  }
  error_page   500 502 503 504/50x.html;
  location = /50x.html {
  root   html;
  }
  }
  ###
  server {
  listen       80;
  server_namebbs.etangbo.com bbs1.etangbo.com;
  #日志存放路径
  access_log/app/log/bbs/host.access.logmain;
  location / {
  root   /data/bbs;
  indexindex.html index.htm;
  }
  error_page   500 502 503 504/50x.html;
  location = /50x.html {
  root   html;
  }
  }
  ###
  server {
  listen       80;
  server_nameblog.etangbo.com blog1.etangbo.com;
  #日志存放路径
  access_log/app/log/blog/host.access.logmain;
  location / {
  root   /data/blog;
  indexindex.html index.htm;
  }
  error_page   500 502 503 504/50x.html;
  location = /50x.html {
  root   html;
  }
  }
  }

页: [1]
查看完整版本: nginx 别名配置