http redirect to https:

        if ($http_cf_visitor ~ '"scheme":"http"'){
rewrite ^/(.*)$ https://$http_host$ last;
}
proxy_pass http://scholar.google.com;
proxy_set_header Host scholar.google.com;

when 403 404 error then query node_app:

    location / {
root /www/www.site.com/public_html;
index index.html; location ~ /$ {
error_page = @node_app;
} location = /index.html {
expires 5m;
}
}

node_app:

    location @node_app {
proxy_pass http://127.0.0.1:;
proxy_set_header Host $http_host;
}

动态反向代理:

resolver 223.5.5.5;

    location ~ /(\w+)(.*)$ {
proxy_pass http://m.$1.domain.com$2?$args;
proxy_set_header Host m.$.domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header User-Agent $http_user_agent;
sub_filter \"/ \"http://$http_host/$1/;
#sub_filter \"http://m.$1.domain.com/ \"http://$http_host/$1/;
sub_filter_once off;
}

编译nginx常用配置选项:

./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic

nginx相关的一些记录的更多相关文章

  1. 转载:Nginx 相关介绍

    转载自:https://www.cnblogs.com/wcwnina/p/8728391.html Nginx 相关介绍(Nginx是什么?能干嘛?)   Nginx的产生 没有听过Nginx?那么 ...

  2. tomcat及nginx相关,格式化输出,配置及日志解析

    1.https://www.cnblogs.com/jingmoxukong/p/8258837.html?utm_source=gold_browser_extension       Tomcat ...

  3. Nginx配置日志格式记录cookie

    Nginx配置日志格式记录cookie1. 一般用来做UV统计,或者获取用户token等. 配置方式:  在nginx的配置文件中有个变量:$http_cookie来获取cookie的信息.配置方式很 ...

  4. nginx 相关命令 nginx -s reload/stop/quit

    nginx 相关命令 学习了:https://www.cnblogs.com/zoro-zero/p/6590503.html start nginx  或者在linux上面直接 nginx ngin ...

  5. 服务器操作nginx相关操作命令

    服务器操作nginx相关操作命令 登录服务器: ssh root@0.0.0.0 -p 22100 启动nginx: /usr/local/nginx/sbin/nginx 查看nginx是否启动 p ...

  6. (转)Nginx的https配置记录以及http强制跳转到https的方法梳理

    Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略 ...

  7. Nginx 相关介绍(Nginx是什么?能干嘛?)

    Nginx的产生 没有听过Nginx?那么一定听过它的"同行"Apache吧!Nginx同Apache一样都是一种WEB服务器.基于REST架构风格,以统一资源描述符(Unifor ...

  8. Nginx的Access日志记录的时机

    想当然了,所以犯了一个低级的错误... nginx的access访问日志可以记录下访问到nginx的相关信息.包含请求地址,请求路径,返回码,请求的处理时间等信息.. 然后问题来了,这个日志是什么时候 ...

  9. nginx日志输出参数记录

    摘自: http://www.cnblogs.com/LoveJulin/p/5082363.html nginx服务器日志相关指令主要有两条,一条是log_format,用来设置日志格式,另外一条是 ...

随机推荐

  1. day26 分布式监控系统开发

    本节内容 为什么要做监控? 常用监控系统设计讨论 监控系统架构设计 监控表结构设计 为什么要做监控? –熟悉IT监控系统的设计原理 –开发一个简版的类Zabbix监控系统 –掌握自动化开发项目的程序设 ...

  2. Python之路,day7-Python基础

    os.system 输出命令结果到屏幕,返回命令执行状态os.popen("dir").read()#会保存命令的执行结果输出py2.7commandscommands.getst ...

  3. iOS NSTimer使用详解 开启、关闭、移除

    定时器定时器详解ios定时器关闭定时器NSTimer 一,要使用一个定时器首先要定义一个定时器: @property (strong, nonatomic) NSTimer *myTimer;//定时 ...

  4. docker使用中国镜像

    最近使用docker,在国内下载速度很不稳定,所以一直在找中国的镜像仓库,又是改配置又是命令行,最后发现网易提供了一个不错的公共仓库,直接从仓库下载就可以了 docker pull hub.c.163 ...

  5. Adobe 软件防止联网激活更改Hosts文件

    来自为知笔记(Wiz) 附件列表

  6. My tool chain in CentOS 7

    - Git Client SmartGit http://www.linuxlinks.com/article/20120129035558195/GitClients.html candidates ...

  7. Install CentOS 7 on Thinkpad t430

    - BIOS settings: - Thinkpadt430, BIOS settings: Config---------------------------- Network: wake on ...

  8. Nginx -- Gzip 压缩功能作用

    1.对应的压缩参数说明# 开启gzip压缩功能gzip on; # 设置允许压缩的页面最小字节数,页面字节数从header头的Content-Length中获取.默认值是0,不管页面多大都进行压缩,建 ...

  9. My Construct

    1.构造函数定义 类中的构造函数用来初始化一个类.构造函数为公有类型,无返回值,用来从类实例中访问类时初始化此类的私有变量. 2.代码 public class UseConstruct { publ ...

  10. coderforces 721b

    题目描述: B. Passwords time limit per test 2 seconds memory limit per test 256 megabytes input standard ...