nginx 別名配置

server {

        listen       80;

        server_name  www.etangbo.com etangbo.com; #,就是在server_name後添加訪問的別名

        #日誌存放路徑

        access_log  /app/log/www/host.access.log main;

        location / {

            root   /data/www;

            index  index.html index.htm;

        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

    }

###

     server {

        listen       80;

        server_name  bbs.etangbo.com bbs1.etangbo.com;

        #日誌存放路徑

        access_log  /app/log/bbs/host.access.log  main;

        location / {

            root   /data/bbs;

            index  index.html index.htm;

        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        } 

   }

###

    server {

        listen       80;

        server_name  blog.etangbo.com blog1.etangbo.com;

        #日誌存放路徑

        access_log  /app/log/blog/host.access.log  main;

        location / {

            root   /data/blog;

            index  index.html index.htm;

        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

   }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章