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 }
  • 相关阅读:
    说到算法怎么可以少了排序呢~
    常用的re正则
    书到用时方恨少-- 正则,待修
    闲逛各个牛人的博客,观后感
    二叉树:B+tree等
    列表,链表,队列
    简述各种锁
    MongoDB
    python爬虫基础应用----爬取无反爬视频网站
    Django缓存管理的6种方法
  • 原文地址:https://www.cnblogs.com/jokoz/p/5387859.html
Copyright © 2011-2022 走看看