2012 年五月
« 四    
 12345
6789101112
13141516171819
20212223242526
2728293031  
  • Posts Tagged ‘nginx’

    如何开启Nginx的目录文件列表功能?配置Nginx目录列表的方法

     

    打开nginx.conf文件,在location server 或 http段中加入
    autoindex on;
    另外两个参数最好也加上去:
    autoindex_exact_size off;
    默认为on,显示出文件的确切大小,单位是bytes。
    改为off后,显示出文件的大概大小,单位是kB或者MB或者GB
    autoindex_localtime on;
    默认为off,显示的文件时间为GMT时间。
    改为on后,显示的文件时间为文件的服务器时间

    配置Nginx目录列表的方法详细参照:http://wiki.nginx.org/NginxChsHttpAutoindexModule

    如果想希望目录列表支持header,footer则可以安装三方插件: http://wiki.nginx.org/NginxNgxFancyIndex

     

    image

    Nginx 启用目录认证 (HttpAuthBasicModule )

     

        在Nginx的目录下有一些文件不允许匿名访问的。可以使用Auth_base命令来进行认证要求。

     

    配置示例:

        server {
    
    	location / {
                autoindex on;
                root   html;
                index  index.html index.htm;
            }
    
            location /mrtg/1.cdn.ghitr.com/ {
            auth_basic "auth";
            auth_basic_user_file /usr/local/nginx/conf/cdn.ghitr.com.auth;
            }
            location /mrtg/2.cdn.ghitr.com/{
            auth_basic "auth";
            auth_basic_user_file /usr/local/nginx/conf/cd.ghitr.com.auth;
            }
    	}

     

    Read the rest of this entry »

    Nginx + Positive SSL 在FireFox浏览器下提示 链接不受信任

        最近将域名转移到Namecheap后使用了其提供的免费SSL服务。并将SSL证书应用到http://Center.ghitr.com 这个网站。

     

        一切配置正常后,用IE/Chrome访问均正常。可是用Firefox访问却提示:“此连接是不受信任的”
    image

     

    检查后得到的结果是: 中级根证书未被安装!

    Read the rest of this entry »

    Nginx中文手册下载

    Nginx 常见应用技术指南[Nginx Tips] 第二版

    作者:NetSeek http://www.linuxtone.org (IT运维专家网|集群架构|性能调优)
    欢迎转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明.
    首发时间: 2008-11-25 更新时间:2009-1-14

    目 录

    一、 Nginx 基础知识
    二、 Nginx 安装及调试
    三、 Nginx Rewrite
    四、 Nginx Redirect
    五、 Nginx 目录自动加斜线:
    六、 Nginx Location
    七、 Nginx expires
    八、 Nginx 防盗链
    九、 Nginx 访问控制
    十、 Nginx日志处理
    十一、 Nginx Cache
    十二、 Nginx 负载均衡
    十三、 Nginx简单优化
    十四、 如何构建高性能的LEMP环境
    十五、 Nginx服务监控
    十六、 常见问题与错误处理.
    十七、 相关资源下载 

     

    Read the rest of this entry »

    OpenSSL CSR Creation for an Nginx Server SSL Certificate

    Nginx CSR Creation using OpenSSL

    How to generate a CSR for Nginx using OpenSSL

    Recommended: Our OpenSSL CSR Wizard will help you generate an OpenSSL command to create your Nginx SSL CSR. Just fill in the form details, click Generate, and paste your customized OpenSSL command into your terminal.

     

    Read the rest of this entry »

    Nginx HttpRewriteModule

    Synopsis

    This module makes it possible to change URI using regular expressions (PCRE), and to redirect and select configuration depending on variables.

    If the directives of this module are given at the server level, then they are carried out before the location of the request is determined. If in that selected location there are further rewrite directives, then they also are carried out. If the URI changed as a result of the execution of directives inside location, then location is again determined for the new URI.

    This cycle can be repeated up to 10 times, after which Nginx returns a 500 error.

    Read the rest of this entry »

    nginx: Setup SSL Reverse Proxy (Load Balanced SSL Proxy)

    Copy form:http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/

     

    Areverse proxy is a proxy server that is installed in a server network. Typically, reverse proxies are used in front of Web servers such as Apache, IIS, and Lighttpd. How do I setup nginx web server as SSL reverse proxy?
    When you’ve multiple backend web servers, encryption / SSL acceleration can be done by a reverse proxy. Nginx can act as SSL acceleration software. It provided the following benefits:

  • Easy of use : Nginx is easy to setup and upgrade.
  • Security : Nginx provide an additional layer of defense as Apache is behind the proxy. It can protect against common web-based attacks too.
  • Load Distribution : nginx use very little memory and can distribute the load to several Apache servers. It can even rewrite urls on fly.
  • Caching : Nginx act as a reverse proxy which offload the Web servers by caching static content, such as images, css, js, static html pages and much more.
  • Compression : Nginx can optimize and compress the content to speed up the load time.

    Our Sample Setup

  • Read the rest of this entry »

    Nginx+Apache搭建Web环境

    顾名思义就是使用nginx作为前端WEB Server.后端使用Apache提供Php支持。

     

    本人可能是闲的蛋疼,买了2个VPS。一个无限空间。

     

    2个VPS就只使用了1个。另一个就拿来做实验!

     

    网上已经有一大堆的关于Nginx+apache的配置实例。开始我也是在网上搜索…结果找到很长很长的配置。配置了后Php到时可以访问。结果静态文件去直接404了。

     

     

    SO。自己研究。

     

    Nginx+apache这个搭配主要是NGINX处理静态文件,Apache处理PHP文件。那么我就直接将Php文件发给Apache。其他文件不做任何处理。

     

    我的Nginx工作在80端口。Apache工作在88端口。
    Nginx侦听任意IP,Apache只侦听127.0.0.1。
    Nginx的配置文件放在:/usr/local/nginx/conf/vhost/
    apache的配置文件放在:/etc/httpd/conf.d/

    Read the rest of this entry »

    HttpEchoModule echo-nginx-module

     

    转自:http://wiki.nginx.org/HttpEchoModule#Installation

     

     

    Name

    ngx_echo – Brings "echo", "sleep", "time", "exec" and more shell-style goodies to Nginx config file.

    This module is not distributed with the Nginx source. See the installation instructions.

    Version

    This document describes echo-nginx-module v0.34 released on September 14, 2010.

    Read the rest of this entry »

    在LNMP环境下安装Gallery

    看到论坛里的一个胸低在求救怎样在LNMP环境下安装 Gallery 。我又正好有空。就装来试了一下。

    测试目录:http://vs12.ghitr.com/gallery3/

    因为Nginx不像Apache那样支持.

    htaccess

    SO。要自己修改Nginx的Vhost配置。

    Read the rest of this entry »

    Pages: 1 2 Next