欢迎光临IT网Linux学习频道

当前位置: > Linux服务器 > nginx >
  • [nginx] nginx的access日志中400 bad request错误的解决方法 日期:2014-06-19 02:44:22 点击:198 好评:0

    在nginx的access.log中存在大量的400错误,并以每天几百M的速度增加,占用大量空间。 复制代码 代码示例:# tail -f /opt/nginx/logs/access.log 116.236.228.180 - - [15/Dec/2010:11:00:15 +0800] - 400 0 - - 116.236.228.180 - - [15/Dec/2010:11:00:15 +...

  • [nginx] nginx + fpm php 输出无法获取内容长度,导致客户端无法处理分块 日期:2014-06-19 02:40:55 点击:205 好评:0

    问题: nginx +fpm,nginx无法探知 php输出内容长度,默认用Tranfer-Encoding:chunked编码 输出。 解决: 对于一些客户端,需要自己解析http协议的,一般不支持chunked解码,这时,可以在php输出里 加一个header(Content-Length: length ) 可以覆盖nginx的默...

  • [nginx] nginx配置codeigniter去掉index.php的方法 日期:2014-06-19 02:39:34 点击:106 好评:0

    在nginx.conf中加入如下配置: 代码如下: server { listen 80; server_name yourservername; location / { root /your/root/path/; index index.php index.html index.htm; if (-f $request_filename) { expires max; break; } #if (!-e $request_filename)...

  • [nginx] Centos下yum安装nginx+PHP-FPM+eAccelerator+mysql 日期:2014-06-19 02:37:53 点击:131 好评:0

    首先,添加安装源 Centos 默认官方源中没有nginx 和 php-fpm,所以必须添加第三方源,否则就只能自己编译了。 添加[CentALT]源 在/etc/yum.repo.d 目下创建 alt.ru.repo 文件内容如下: 复制代码 代码如下:[CentALT] name=CentALT Packages for Enterprise L...

  • [nginx] nginx与tomcat环境中获取真实IP的办法 日期:2014-06-19 02:37:46 点击:190 好评:0

    第一步:在nginx.conf中配置反向代理时把真实IP带上,例如: server { listen 80; server_name boyan.com; location ~ ^/(WEB-INF)/ { deny all; } location / { proxy_pass http://localhost:8888; proxy_set_header X-Real-IP $remote_addr; } } 第二步:...

  • [nginx] 将nginx制作为linux系统服务 日期:2014-06-19 02:36:21 点击:72 好评:0

    把Nginx加为linux的系统服务,其实就是创建一个启动管理脚本,类似于httpd可以使用service启动与停止,可以使用chkconfig配置服务一样。 代码如下: #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # descript...

  • [nginx] nginx报错502 Bad Gateway原因与解决方法 日期:2014-06-19 02:35:26 点击:59 好评:0

    网站报错: 502 Bad Gateway /nginx/0.8.15 解释: 502 Bad Gateway 服务器作为网关或者代理时,为了完成请求访问下一个服务器,但该服务器返回了非法的应答。这个应该是网管使用了过滤软件。 可能是nginx高负载造成的! 解决:增加了fastcgi的相应请求时间...

  • [nginx] nginx gzip 简介 日期:2014-06-19 02:34:38 点击:166 好评:0

    gzip(GNU-ZIP)是一种压缩技术。经过gzip压缩后页面大小可以变为原来的30%甚至更小,这样,用户浏览页面的时候速度会块得多。gzip的压缩页面需要浏览器和服务器双方都支持,实际上就是服务器端压缩,传到浏览器后浏览器解压并解析。浏览器那里不需要我们担心...

  • [nginx] Nginx不支持ThinkPHP配置pathinfo问题的解决方法 日期:2014-06-19 02:33:35 点击:271 好评:-2

    前言 ThinkPHP支持通过PATHINFO和URL rewrite的方式来提供友好的URL,只需要在配置文件中设置 URL_MODEL = 2 即可。 在Apache下只需要开启mod_rewrite模块就可以正常访问了,但是Nginx中默认是不支持PATHINFO的,这使得用TP写程序变的非常有局限性。 需要修...

  • [nginx] nginx做负载均衡时backend server如何取得真实IP 日期:2014-06-19 02:30:38 点击:89 好评:0

    首先,作为loadblance的nginx需要添加下面的配置: 复制代码 代码如下:proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; X-Real-IP和X-Forwarded-For可以2选1,也可以...

  • 首页
  • 上一页
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 下一页
  • 末页
  • 2012010
栏目列表
推荐内容