zoukankan      html  css  js  c++  java
  • nginx---Beginner's Guide

    一 启动

    nginx -s signal
    

    Where signal may be one of the following:

    • stop — fast shutdown
    • quit — graceful shutdown
    • reload — reloading the configuration file
    • reopen — reopening the log files

    nginx -c nginx.conf  指定配置文件

    二 配置文件

    块关系

      main    *events

             *http       **server    ***location     

          

    三 目录设置

    设置文件根目录

    location / {
        root /data/www;
    }

    四 简单代理设置

    设置1


    server {
      代理服务器IP+PORT设置 location / { proxy_pass http://localhost:8080/; }
    所有 .(gif|jpg|png) 文件均访问本服务器,其他文件访问代理服务器
    ~ 表示后面为正则表达式 location ~ .(gif|jpg|png)$ { root /data/images; }
    }

    设置2

    server {
      所有.html文件都访问代理服务器 location ~ *.html$ { proxy_pass http://localhost:8080/; } }

    五 FastCGI代理设置

    所有.cgi请求都访问FastCGI代理
    location ~ *.cgi$ {
      设置FastCGI代理IP+PORT fastcgi_pass localhost:9000;
      设置默认.cgi fastcgi_index index.cgi;
      包含fastcgi.conf中的所有fastcgi_param include fastcgi.conf }
  • 相关阅读:
    JQ常用代码
    websocket练习
    动软生成器 model生成模板
    动软生成器 Liger model生成模板
    SVN各种错误提示产生原因及处理方法大全
    winfom实现关闭后一直运行
    在yii中使用分页
    html文字垂直居中
    给浏览器网页标签页添加图标
    html 遇到margin居中的问题
  • 原文地址:https://www.cnblogs.com/jokoz/p/5387859.html
Copyright © 2011-2022 走看看