2019独角兽企业重金招聘Python工程师标准>>>

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
    #tcp_nopush     on;

#keepalive_timeout  0;
    keepalive_timeout  65;

#gzip  on;
    
    upstream net.mjduan.com{
        server 192.168.0.103:8080 weight=2;
        server 192.168.0.108:8080 weight=1;
    }

server {
        listen       80;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

#将jsp交给tomcat
        #location ~ \.jsp$ {
        #    proxy_pass http://localhost:8080;
        #}
        
        #将静态文件交给nginx,不经过tomcat
        #location ~ \.(html|js|css|png|gif)$ {
        #    root E:/Tomcat7/webapps;
        #}
        
        #spring mvc交给tomcat
        #location / {
        #    proxy_pass http://localhost:8080;
        #}

location / {
            proxy_pass http://net.mjduan.com;
            proxy_redirect default;
        }
        
        #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   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;
        #}
    }

# another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

# HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

#    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

转载于:https://my.oschina.net/u/2518341/blog/758267

学习nginx 下面只是简单的配置文件相关推荐

  1. 学习Nginx,看完这篇超详细的文章就够了

    目录 本文简介 一.Nginx的基本概念 1.1.Nginx是什么? 1.2.Nginx能帮助我们做些什么? 1.3.Nginx的特性 二.Nginx的安装 2.1.环境介绍 2.2.安装Nginx ...

  2. 入门学习Nginx代理服务器?就看这篇Nginx进阶学习最佳配置实践指南

    前置基础知识学习 1.Nginx基础安装与配置详细 https://blog.weiyigeek.top/2019/9-1-121.html 2.Nginx进阶学习之最佳配置实践指南 https:// ...

  3. 学习Nginx这一篇就够了

    目录 第一章 Nginx概述 1.1.Nginx概述 1.2.Nginx官网 1.3.Nginx用处 第二章 Nginx单实例安装 2.1.环境说明 2.2.安装依赖 2.3.Nginx下载 2.4. ...

  4. 深入浅析nginx部署及简单优化

    Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的.本文重点给大家介绍nginx部署及简单优化方案,感兴趣的朋友一起看看吧 Nginx是lgor Sysoev为俄 ...

  5. nginx系列之二:配置文件解读

    ** 前言 ** nginx系列之一:nginx入门 nginx系列之二:配置文件解读 nginx系列之三:日志配置 nginx系列之四:web服务器 nginx系列之五: 负载均衡 nginx系列之 ...

  6. nginx解析漏洞简单复现及修复

    Nginx简介 Nginx是一款轻量级的web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,其特点是占内存小.并发能力强:国内使用Nginx的有百度.京东.新浪.网易.腾讯.淘宝等 ...

  7. 一张图学会python高清图-一张图带你学会Python,学习Python的非常简单,附教程

    原标题:一张图带你学会Python,学习Python的非常简单,附教程 网上有这样一张图片,信息量很大,通常会被配上标题"一张图让你学会Python" 这张图流传甚广,但我没有找到 ...

  8. Nginx学习---Nginx的详解_【all】

    1.1. Nginx简介 1.什么是nginx nginx:静态的,开源的www软件,可以解析静态的小文件(低于1M ),支持高并发占用较发少的资源(3W并发,10个进程,内存150M),跨平台 te ...

  9. Nginx反向代理——简单体验Nginx反向代理功能

    一.引言 从Nginx入门学习开始.到现在所讲的Nginx反向代理.我们的Nginx学习已经进入白热化状态,前面所学只是铺垫,真正在公司的业务场景中Nginx绝大数用来反向代理+负载均衡所用.相信大家 ...

最新文章

  1. ASP.NET页生命周期概述
  2. python数据导入一个列表_Python基础数据类型list 列表
  3. wxpython嵌套panel布局的一个问题
  4. C#中访问私有成员技巧
  5. Linux 基本命令(十)--grep 常用命令
  6. Topcoder SRM 637 (Div.2)
  7. 判断字符串括号是否闭合(){}[]
  8. 【MATLAB图像融合】[18]双通道PCNN模型实现图像融合
  9. 企业资源规划 ERP
  10. C# 利用winrar解压带密码的压缩包
  11. 打开conda环境报错:UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x9a in position 317: illegal multibyt
  12. Deepin20.4系统中wine优化设置
  13. 10、持续集成流水线实践:流水线建设从Jenkins部署开始
  14. 【Ablation Studies 理解】深度学习模型组件的对比实验/性能分析
  15. 如何用潜类别混合效应模型(Latent Class Mixed Model ,LCMM)分析老年痴呆年龄数据
  16. java和golang哪个值得入手,附源代码
  17. Excel2010条件格式结合公式和格式刷使用存在严重bug
  18. transform:translate
  19. java学习笔记(file类):
  20. EasyNVS摄像机公网全终端无插件网页摄像机直播管理服务之网页无插件直播服务搭建流程

热门文章

  1. Spring集成Quartz定时任务框架介绍
  2. UEditor 插入图片大于2M提示文件大小超出范围解决办法
  3. Delphi:ADOConnection连接SQLServer自动断网问题解决
  4. JavaScript验证
  5. 全国计算机等级考试题库二级C操作题100套(第07套)
  6. linux ndk编译so,有的APP NDK 编译的SO文件 无法调用 PackageManager
  7. 安卓短信加密_发短信控制车辆!苹果发布ios14,手机可作车钥匙
  8. php生成文件index.html,Typecho生成静态首页index.html文件
  9. sock 文件方式控制宿主机_sock
  10. 项目管理:软件工程相关知识笔记