一:下载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. Go错误

    1. error package main import ( "errors" "fmt" ) func main() { /* error:内置的数据类型,内 ...

  2. P&R 3

    Floorplan: 要做好floorplan需要掌握哪些知识跟技能? 通常,遇到floorplan问题,大致的debug步骤跟方法有哪些? 如何衡量floorplan的QA? Floorplan是后 ...

  3. .Net Core 认证组件之Cookie认证组件解析源码

    接着上文.Net Core 认证系统源码解析,Cookie认证算是常用的认证模式,但是目前主流都是前后端分离,有点鸡肋但是,不考虑移动端的站点或者纯管理后台网站可以使用这种认证方式.注意:基于浏览器且 ...

  4. SPOJ Distinct Substrings

    给定一个字符串,求不相同子串个数.每个子串一定是某个后缀的前缀,那么原问题等价于求所有后缀之间的不相同子串个数.总数为n*(n-1)/2,再减掉height[i]的和就是答案 #include< ...

  5. Markdown Learning Notes

    Markdown 教程 Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档. Markdown 语言在 2004 由约翰·格鲁伯(英语:John Gruber)创建. ...

  6. windows centos php-beast 安装

    https://github.com/imaben/php-beast-binaries windows下 可以直接在这里下载dll 根据自己的php版本  还有是不是线程安全的 来选择下载对应的 放 ...

  7. MYSQL命令练习及跳过数据库密码进行密码重新设置

        2.看当前所有数据库:show databases; 3.进入mysql数据库:use mysql; 4.查看mysql数据库中所有的表:show tables; 5.查看user表中的数据: ...

  8. 【笔记】单步跟踪法与UPX的脱壳理解

    用PEiD查壳           UPX v0.89.6 - v1.02 / v1.05 - v1.22    这个是入门的壳,只是一个简单的压缩壳 用Stud_PE查看PE文件头信息       ...

  9. Thymeleaf Tutorial 文档 中文翻译

    原文档地址:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html Thymeleaf官网地址:https://www.thym ...

  10. 17 JavaScript Cookies

    关于Cookie: Cookie是存储在电脑上的文本文件中的一些数据 Cookie致力于解决如何在连接关闭后记录客户单的用户信息 Cookie以键值对的形式存储,例如username=John Doe ...