zoukankan      html  css  js  c++  java
  • nginx 静态资源访问配置

     server {
            listen 443;
            server_name localhost;
            ssl on;
    # 此处可配置域名访问,默认的首页
    
    #       root html;   #目录
    #       index weixin/index.html;
    
    #       rewrite ^/ https://www.baidu.com  
    
    
    #       location / {
    #               root html;
    #               index index.html index.htm;
    #       }
    
    # 配置所有的静态资源访问路径
            location ~ .*.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
            {
                    root html/weixin;   #目录
                    index index.html;
                    #expires定义用户浏览器缓存的时间为1天,如果静态页面不常更新,可以设置更长,这样可以节省带宽和缓解服务器的压力
                    expires      1d;
            }
    
        }
  • 相关阅读:
    FJ省队集训DAY3 T1
    FJ省队集训DAY2 T2
    FJ省队集训DAY2 T1
    FJ省队集训DAY1 T1
    POJ 1225 Substrings
    BZOJ 2732 射箭
    Light OJ 1314 Names for Babies
    SPOJ220 Relevant Phrases of Annihilation
    POJ3683 Falsita
    ES6 常用语法
  • 原文地址:https://www.cnblogs.com/big-cut-cat/p/11624015.html
Copyright © 2011-2022 走看看