您的位置:首页 > 运维架构 > Nginx

nginx中配置多个虚拟主机实例

2016-09-07 16:17 507 查看
server

           {

             listen  80;

              server_name     dodadm113.sky5.com;

             index           index.php index.html;

             #autoindex on;

            root       /app/nginx/wwwroot/dodadm.sky5.com/wwwroot;

              #error_page 404 = /404.php;

1236              location ~ \.php$

1237              {

1238                 fastcgi_pass   127.0.0.1:9001;

1239                 fastcgi_index  index.php;

1240                 fastcgi_intercept_errors on;

1241                 include        fcgi.conf;

1242              }

1243              location ~* ^.+\.(jpg|jpeg|gif|css|js|xml|swf) {

1244                      expires         max;

               }

          }

     server

         {

             listen  80;

             server_name     sdoadm178.sdo.com;

             index           index.php index.html;

             #autoindex on;

             root       /app/nginx/wwwroot/sdoadm.sdo.com/wwwroot;

1254             #error_page 404 = /404.php;

1255             location ~ \.php$

1256             {

1257                 fastcgi_pass   127.0.0.1:9001;

1258                 fastcgi_index  index.php;

1259                 fastcgi_intercept_errors on;

1260                 include        fcgi.conf;

1261             }

1262             location ~* ^.+\.(jpg|jpeg|gif|css|js|xml|swf)

1263             {

1264                 expires         max;

1265             }

1266          }

  server

          {

             listen  80;

1270             server_name     doltest113.dance.com;

1271             index           index.php index.html;

1272             #autoindex on;

1273             root       /app/nginx/wwwroot/doltest.dance.com/wwwroot;

1274             #error_page 404 = /404.php;

1275             location ~ \.php$

1276             {

1277                   fastcgi_pass   127.0.0.1:9001;

1278                   fastcgi_index  index.php;

1279                   fastcgi_intercept_errors on;

1280                   include        fcgi.conf;

1281             }

1282             location ~* ^.+\.(jpg|jpeg|gif|css|js|xml|swf) {

1283                 expires         max;

1284             }

1285          }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: