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

来源:互联网 发布:大数据就业方向 编辑:程序博客网 时间:2024/06/13 14:15
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          }
0 0
原创粉丝点击