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. Vim找不到配色文件的解决方法

    Vim新出了8.0,又成功的勾起了我的好奇心. 重新从零开始配置,结果第一步设置配色主题就没过,好丢人-- 提示找不到evening.vim配色文件,于是上网查了一下,有说改环境变量的,又说改这个改那 ...

  2. 2016HUAS_ACM暑假集训3F - Jungle Roads

    这个题目属于最小生成树问题,可以用Prim,也可以用Kruskal(还没试).题意简单直接,给你一个图,求出它最小生成树的权值. 题目最有趣的地方就是图的顶点是字母,稍微处理一下就好了. Sample ...

  3. 关于android R.layout.没有出现自己写的布局解决方法

    直接上解决方法 1.若import了androi.R直接删除,导入自己包下的R文件,例如com.example.my.R 2.若上面的做了后还有错误,应该是包名不一致导致的,即com.example. ...

  4. HTML 图像显示

    HTML 图像显示:图像标签:<img>,源属性:Src<img>是空标签,没有闭合标签,它只包含属性:显示图像时需要调用源属性src:src的值是图像的地址:语法:<i ...

  5. linux下查看系统信息

    lspci:   这个工具用来查看所有连接到pci总线上的所有设备信息. 如果有些系统没有lspci,安装后即可使用,有些老死的版本中需要root权限才可使用. 一些用法: lspci    列出所有 ...

  6. 0x00linux32位汇编初入--前期准备

    0x00汇编初入--前期准备 一.汇编工具 在linux平台下常用的编译器为as,连接器为ld,使用的文本编辑器为vim,汇编语法为att 以下是一些工具: addr2line 把地址转换为文件名和行 ...

  7. EAN

    public static string EAN13(string s) { ;//输入的校验码 if (!Regex.IsMatch(s, @"^\d{12}$")) { if ...

  8. C#读取文件夹大小

    今天需要做一个读取文件夹大小的功能,为了避免遍历文件夹下所有文件并求出总大小,找到如下的好方法: 首先要在项目中引用一个COM组件:Microsoft Scripting Runtime,这个在Ref ...

  9. 多表数据连接 Left join

    一个我写的实例:其中多表连接,一共连接了3个表.使用聚集函数SUM,用到了GROUP BY SELECT a.[UserID],b.[Name],sum (c.[Money]+c.[Bank])as  ...

  10. 【转】STM32中的抢占优先级、响应优先级概念

    STM32(Cortex-M3)中有两个优先级的概念--抢占式优先级和响应优先级,有人把响应优先级称作'亚优先级'或'副优先级',每个中断源都需要被指定这两种优先级. 具有高抢占式优先级的中断可以在具 ...