zoukankan      html  css  js  c++  java
  • Nginx配置文件

    nginx.conf:

    全局块:配置影响nginx全局的指令。如:用户组,nginx进程pid存放路径,日志存放路径,配置文件引入,允许生成worker process故障等
    events块:配置影响 Nginx 服务器与用户的网络连接,常用的设置包括是否开启对多 work process下的网络连接进行序列化,是否允许同时接收多个网络连接,选取哪种事件驱动模型来处理连接请求,每个 word process 可以同时支持的最大连接数等。
    http块:
    http全局块:配置的指令包括文件引入、MIME-TYPE 定义、日志自定义、连接超时时间、单链接请求数上限等。错误页面等
    server块:这块和虚拟主机有密切关系,虚拟主机从用户角度看,和一台独立的硬件主机是完全一样的。每个 http 块可以包括多个 server 块,而每个 server 块就相当于一个虚拟主机。
    location1:配置请求的路由,以及各种页面的处理情况
    location2

    server {
        listen       80;
        server_name  gulimall.com;
    
        #charset koi8-r;
        #access_log  /var/log/nginx/log/host.access.log  main;
    
        location / {
            #又转回到本机
            proxy_pass http://192.168.56.1:10000;
        }
    
        #error_page  404              /404.html;
    
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ .php$ {
        #    proxy_pass   http://127.0.0.1;
        #}
    
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ .php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}
    
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /.ht {
        #    deny  all;
        #}
    }
    

      

  • 相关阅读:
    redis在Linux的下载和安装
    redis 安装启动及设置密码windows
    Lambda学习---方法引用和其他基本应用
    Lambda学习---StreamApi使用
    java对象的访问定位
    java对象是如何创建的
    通过“减少内存”的方式解决内存溢出的问题
    springmvc配置中,mapper一直依赖注入不进去的问题记录
    为什么要简化代码书写
    压力测试工具
  • 原文地址:https://www.cnblogs.com/vincentmax/p/14470217.html
Copyright © 2011-2022 走看看