码迷,mamicode.com
首页 > 其他好文 > 详细

nginx如何配置虚拟主机

时间:2018-06-10 00:32:33      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:TE   ipv6   local   exp   path   csharp   ble   precision   sha   

server  
    {  
        listen 80;  
        #listen [::]:80 default_server ipv6only=on;  
        server_name local.presion.caomall.net;  
        index index.html index.htm index.php;  
        root  /home/wwwroot/default/precision/Public;  
  
        #error_page   404   /404.html;  
        include enable-php-pathinfo.conf;  //注意这里从  nginx.conf 复制过来,如果不修改这里,主入口文件不支持require
  
        location /nginx_status  
        {  
            stub_status on;  
            access_log   off;  
        }  
  
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$  
        {  
            expires      30d;  
        }  
  
        location ~ .*\.(js|css)?$  
        {  
            expires      12h;  
        }  
  
        location ~ /\.  
        {  
            deny all;  
        }  
  
        access_log  /home/wwwlogs/access.log;  
    }  

  

nginx如何配置虚拟主机

标签:TE   ipv6   local   exp   path   csharp   ble   precision   sha   

原文地址:https://www.cnblogs.com/pansidong/p/9161782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!