欢迎光临IT网Linux学习频道

当前位置: > Linux服务器 > nginx >
  • [nginx] Nginx 设置静态文件缓存时间 日期:2014-07-09 19:05:29 点击:168 好评:0

    Nginx设置静态文件缓存时间,如下所示: 复制代码 代码如下: location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } 说明: 图片默认缓存30天 JS和CSS默认缓存1小时 大家可以根据需求设置Nginx对静态文件...

  • [nginx] Nginx status状态开启方法介绍 日期:2014-07-09 19:04:50 点击:85 好评:0

    开启方法: 复制代码 代码示例: server { ... location /nginx_status { stub_status on; access_log off; allow 123.123.123.123; # 允许访问的 IP allow 127.0.0.1; deny all; } } 说明: active connections 当前Nginx正处理的活动连接数。 serveraccepts...

  • [nginx] nginx缓存本地静态文件 日期:2014-07-09 19:04:10 点击:91 好评:0

    使用nginx缓存本地静态文件,由同一个nginx来解析。 使用if不能嵌套,所以只能使用本地的IP跳转一下,我的cache使用的nginx命名cache_one配置如下。 如果本地跳转有问题可以再hosts表中修改一下指向。 ##---pic 复制代码 代码如下: upstream local_img { ser...

  • [nginx] nginx open_file_cache指令 导致静态文件不能及时更新和出现网页 日期:2014-07-09 19:03:43 点击:165 好评:0

    做一个文字直播的项目,为了减轻数据库及web服务器负载,做了以下处理: web前端有CDN,由于直播需要时效性,所以缓存不能太久,可以配置nginx对静态文件的缓存时间: 复制代码 代码如下: location ~ ^/zhibo/.*\.(html)$ { root /data/www; expires 30s; }...

  • [nginx] nginx运行php"No input file specified"错误的解决方法 日期:2014-07-09 18:46:50 点击:140 好评:0

    打开一个页面?phpphpinfo(); ? 然后在游览器下运行:页面提示 No input file specified. FastCGI模式下访问php文件时,出现No input file specified.错误 查看access.log 发现是 404 原因分析 : 1、任何对.php文件的请求,都简单地交给php-cgi去处理,但没...

  • [nginx] 通过例子来看nginx下的Rewrite规则 日期:2014-07-09 18:39:56 点击:168 好评:0

    Apache下的Rewrite规则是详细的规则,nginx下的中文文档好像没有看到,这里有个英文的文档:http://wiki.nginx.org/NginxHttpRewriteModule。 Apache下的Rewrite规则基本上到nginx下,也可以直接使用,不行的话用引号引起来一般就都可以了。 nginx的rewrite...

  • [nginx] nginx中“nginx could not build the server_names_hash”的解决 日期:2014-07-09 18:38:31 点击:130 好评:0

    问题:在一个服务器中增加了一些站点别名,差不多有20多个吧,重启nginx时,有如下的错误提示: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32 解决方法: 在配置文件的http{}段增加一行配置: server_nam...

  • [nginx] nginx php配置与nginx启动脚本 日期:2014-07-09 18:36:41 点击:174 好评:0

    nginx中php配置,sh脚本来启动、关闭、重启nginx。 一、配置文件 nginx.conf 复制代码 代码如下: server { listen 8080 ; server_name localhost; location / { root /home/work/htdocs; expires 1d; autoindex on; index index.php index.html; } location...

  • [nginx] Nginx+PHP(FastCGI)遇到no input file specified的解决方法 日期:2014-07-09 18:34:10 点击:76 好评:0

    配置完成Nginx+PHP+MySQL环境以后,稳定运行几个月,但是最近发现有个问题,如果请求的PHP文件不存在,不是报404错误,而是出现no input file specified的提示。 检查问题,分析原因: 在于Nginx没有检查这个PHP文件是否存在,直接把所有PHP文件都交由后端ph...

  • [nginx] 教你在Gentoo中配置Nginx+MySQL+PHP(FastCGI)环境 日期:2014-07-09 17:37:43 点击:77 好评:0

    教你在Gentoo中配置Nginx+MySQL+PHP(FastCGI)环境,有需要的朋友可以参考下。 安装 Nginx * 一条命令搞定: USE=fastcgiemergenginx * 新建用户和组: groupadd www useradd www -g www Nginx 安装好后默认会添加 nginx 组和 nginx 用户,不过我本身还是习...

  • 首页
  • 上一页
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 下一页
  • 末页
  • 2012009
栏目列表
推荐内容