一:下载nginx方式

1.yum install nginx

2.源码安装

二:学习网址

nginx documentation — DevDocs

三:配置文件信息

server {
listen 80 ;
listen [::]:80 ipv6only=on;
listen 443 default ssl;
listen [::]:443 default ssl;
#listen [::]:443 ssl ;
#listen 443 ssl;
ssl off;
ssl_certificate /etc/nginx/sslkey/kcs.default.crt;
ssl_certificate_key /etc/nginx/sslkey/kcs.default.key; server_name test1116.com;
#max_ranges 0;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on; error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;   #302跳转使用
location = /test302.html {
root html;
rewrite ^/(.*)$ http://127.0.0.1/a/123.mp4 redirect; } location = /index12.html {
root /home/root/auto_test/Report/html/;
} location /a/ {
root html;
rewrite ^/(.*)$ http://127.0.0.1/b/123.mp4 redirect;
}

  # 配合html/php上传文件使用
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
client_max_body_size 30m;
# fastcgi_param HTTPS on;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param SCRIPT_FILENAME /etc/nginx/html$fastcgi_script_name;
include fastcgi_params;
#include fastcgi.conf;
} error_page 405 =200 $uri;
#error_page 405 =200 @405;
#location @405 {
# root /etc/nginx/html;
#root /tmp/upload_tmp2;
# proxy_method GET;
#} #location /b {
# root html;
# rewrite /(.*) http://127.0.0.1/c/yunkong.mp4 redirect;
# } #location /c {
# root html;
# rewrite /(.*) http://127.0.0.1/d/yunkong.mp4 redirect;
# } #location /d {
# root html;
#} location /refresh30.html {
expires 30s;
root html;
} location ~^/.* {
root /etc/nginx/html;
add_header 123 123; #添加请求接口响应头信息
gzip on; #响应信息是否进行压缩
# gzip_types text/html text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
#gzip_vary on;
} }

【原】nginx配置文件的更多相关文章

  1. gitlab自带的Nginx与原Nginx冲突的解决方案

    gitlab 推荐方案2 默认情况下,gitlab使用自带的Nginx,占用80端口,这样就与系统原本安装的Nginx冲突.导致其中一个nginx无法启动 我的gitlab可以正常启动,当再部署一个接 ...

  2. Nginx配置文件nginx.conf中文详解(转)

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  3. 查看nginx配置文件路径

    进入nginx安装目录(我的是/usr/local/nginx-1.7.8/) 进入sbin目录,输入 ./nginx -t查看nginx配置文件路径以及该文件语法是否正确 ./nginx -v查看n ...

  4. Nginx配置文件详解

    Nginx是一款面向性能设计的HTTP服务器,相较于Apache.lighttpd具有占有内存少,稳定性高等优势. ######Nginx配置文件nginx.conf中文详解##### #定义Ngin ...

  5. 005.nginx配置文件

    1.替换nginx主配置文件 通过前面的配置,LNMP的环境已经搭建完成,现在我们替换nginx配置文件: [root@huh ~]# cd /usr/local/nginx/conf/[root@h ...

  6. nginx配置文件nginx.conf超详细讲解

    #nginx进程,一般设置为和cpu核数一样worker_processes 4;                        #错误日志存放目录 error_log  /data1/logs/er ...

  7. 通过nginx配置文件抵御攻击

    通过nginx配置文件抵御攻击 囧思九千 · 2013/11/12 12:22 0x00 前言 大家好,我们是OpenCDN团队的Twwy.这次我们来讲讲如何通过简单的配置文件来实现nginx防御攻击 ...

  8. Nginx配置文件nginx.conf详细说明

    Nginx配置文件nginx.conf详细说明 #worker_processes 8; #worker_cpu_affinity 00000001 00000010 00000100 0000100 ...

  9. 【转】Nginx配置文件详细说明

    Nginx配置文件详细说明 在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data;    #启动进程,通常设置成和cpu的数量相等 ...

  10. 一、Nginx配置文件详解

    配置文件介绍 主要有两部分:分别是 main:主体部分 http{}:虚拟主机配置部分 配置指令主要以分号结尾:配置语法:directive value1 [value2 ....] 支持使用的变量 ...

随机推荐

  1. JavaScript对象,函数,作用域

    JavaScript对象 在 JavaScript中,几乎所有的事物都是对象.JavaScript 对象是拥有属性和方法的数据. var car = {type:"Fiat", m ...

  2. label 阻止冒泡 防止点击label 触发2次事件

    // 必须要把 jnput的外面的label加上事件阻止冒泡,否则点击label的时候,会冒泡到input上 再次触发input的点击事件 $('.xt_order_cleft_modb_rl_dx' ...

  3. Windows上搭建hexo博客

    1.windows上下载git(官网太慢),建议去其他地方下载啊(右键出现 Git Bash Here 的标志就安装完成) 2.安装npm:http://nodejs.cn/download/ 3.安 ...

  4. Django--模型管理器

    参考https://blog.csdn.net/qq_34788903/article/details/87889451 可参考视频 :  https://www.bilibili.com/video ...

  5. Laravel Vuejs 实战:开发知乎 (3)本地化和自定义消息

    1.本地化 由于所有blade默认采用的是 _('')方式输出标签文本,所以可以安装一个语言包,直接指定本地语言为zh_CN即可: 安装 https://github.com/caouecs/Lara ...

  6. maplotlib python 玩具绘图 横向纵向条状图

    from matplotlib import font_manager#解决zh-han图形汉字乱码 my_font = font_manager.FontProperties(fname=" ...

  7. Flex:实例

    目的: 代码: <!--pages/index/index.wxml--> <view class="container"> <view class= ...

  8. Unix系统级I/O

    在Unix系统中,一且皆为文件.一个Linux文件就是一个字符序列,并且所有的I/O设备都被模型化成了文件.而所有的输入输出都被当作对对应文件的读和写.Linux提供了一组简单.低级的接口,使得所有的 ...

  9. [0CTF 2016] piapiapia

    一道非常有意思的反序列化漏洞的题目 花费了我不少时间理解和记忆 这里简单记录其中精髓 首先打开是一个登陆页面 dirsearch扫描到了www.zip源码备份 update.php <?php ...

  10. Django框架中的Cookie和Session

    学习内容: (1)cookie (2)session Web是基于请求/响应模式,HTTP协议是无状态的,但是基于 Internet的各种服务系统应运而生,建立商业站点或者功能比较完善的个人站点,常常 ...