https和http共存的nginx简单配置】的更多相关文章

server{ listen 80; listen 443 ssl; ssl_certificate /usr/local/nginx/ssl/www.demo.com/www.demo.com.cn-ca-bundle.crt;#############ssl证书 ssl_certificate_key /usr/local/nginx/ssl/www.demo.comwww.demo.com.key;############ssl证书key autoindex on; #开启读取非nginx…
server {        listen       80;        listen      443 ssl;        server_name  test.xx.com;        index index.html index.htm index.php;        root /usr/local/default;        location ~ .*\.(php|php5)?$        {                #fastcgi_pass  unix:…
Nginx 配置文件结构如果你下载好啦,你的安装文件,不妨打开 conf 文件夹的 nginx.conf 文件,Nginx 服务器的基础配置,默认的配置也存放在此.在 nginx.conf 的注释符号位#nginx 文件的结构,这个对刚入门的同学,可以多看两眼.默认的 config#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/er…
nginx.conf listener监听端口 server_name监听域名 location{}是用来为匹配的 URI 进行配置,URI 即语法中的“/uri/”.location  / { }匹配任何查询,因为所有请求都以 / 开头. root指定对应uri的资源查找路径,这里html为相对路径,完整路径为/opt/ opt/nginx-1.7.7/html/ worker_connections表示每个工作进程的最大连接数 server{}块定义了虚拟主机 index指定首页index文…
nginx 配置反向代理,转发请求到另一个域名 在server中加入 location /${alias} { proxy_buffer_size 128k; proxy_buffers 32 32k; proxy_busy_buffers_size 128k; add_header X-Static transfer; proxy_pass http://xxxx.com/${alias}; } ${alias}要与被访问目录的路径相同,假设另一个域名为: http://abc123.com/…
nginx.conf中,一个server段对应一个虚拟主机,如果要增加多个虚拟主机,增加多个server段即可. server { listen ; access_log logs/.log; location / { root html/; index index.html; } } server { listen ; access_log logs/.log; location / { root html/; index index.html; } } server { listen ; a…
location ~ \.php {    #去掉$ root          H:/PHPServer/WWW; fastcgi_pass   127.0.0.1:9000; fastcgi_index  index.php; fastcgi_split_path_info ^(.+\.php)(.*)$;     #增加这一句 fastcgi_param PATH_INFO $fastcgi_path_info;    #增加这一句 fastcgi_param  SCRIPT_FILENA…
最近在看  HTTP权威指南   看到介绍了HTTPS的ssl,自己就动手测试了下,将步骤记录下 HTTPS简介 什么是HTTPS?百科是这样解释的.HTTPS(全称:Hyper Text Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道.即HTTP下加入SSL层,HTTPS的安全基础是SSL,因此加密的详细内容就需要SSL.现在它被广泛用于互联网上安全敏感的通讯,例如交易支付等. 使用openssl生成证书 安装openssl…
nginx 软件: a: openssl-1.0.1r.tar.gz tar zxf openssl-1.0.1r.tar.gz b: pcre-8.32.tar.gz tar zxf openssl-1.0.1r.tar.gz cd pcre-8.32 ./configure --prefix=/usr/local/lanmp/lib/pcre #安装目录 make && make install c: zlib-.tar.gz tar zxf zlib-.tar.gz cd zlib-…
原文内容来自于LZ(楼主)的印象笔记,如出现排版异常或图片丢失等问题,可查看当前链接:https://app.yinxiang.com/shard/s17/nl/19391737/7619763f-1730-4887-90dd-c9aa931f3526     NGINX常见使用问题:   Nginx 常见错误码汇总(https://www.cnblogs.com/qinghe123/p/8134606.html)   Nginx 简单文档:https://github.com/DearZh/n…