nginx相关的一些记录
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相关的一些记录的更多相关文章
- 转载:Nginx 相关介绍
转载自:https://www.cnblogs.com/wcwnina/p/8728391.html Nginx 相关介绍(Nginx是什么?能干嘛?) Nginx的产生 没有听过Nginx?那么 ...
- tomcat及nginx相关,格式化输出,配置及日志解析
1.https://www.cnblogs.com/jingmoxukong/p/8258837.html?utm_source=gold_browser_extension Tomcat ...
- Nginx配置日志格式记录cookie
Nginx配置日志格式记录cookie1. 一般用来做UV统计,或者获取用户token等. 配置方式: 在nginx的配置文件中有个变量:$http_cookie来获取cookie的信息.配置方式很 ...
- nginx 相关命令 nginx -s reload/stop/quit
nginx 相关命令 学习了:https://www.cnblogs.com/zoro-zero/p/6590503.html start nginx 或者在linux上面直接 nginx ngin ...
- 服务器操作nginx相关操作命令
服务器操作nginx相关操作命令 登录服务器: ssh root@0.0.0.0 -p 22100 启动nginx: /usr/local/nginx/sbin/nginx 查看nginx是否启动 p ...
- (转)Nginx的https配置记录以及http强制跳转到https的方法梳理
Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略 ...
- Nginx 相关介绍(Nginx是什么?能干嘛?)
Nginx的产生 没有听过Nginx?那么一定听过它的"同行"Apache吧!Nginx同Apache一样都是一种WEB服务器.基于REST架构风格,以统一资源描述符(Unifor ...
- Nginx的Access日志记录的时机
想当然了,所以犯了一个低级的错误... nginx的access访问日志可以记录下访问到nginx的相关信息.包含请求地址,请求路径,返回码,请求的处理时间等信息.. 然后问题来了,这个日志是什么时候 ...
- nginx日志输出参数记录
摘自: http://www.cnblogs.com/LoveJulin/p/5082363.html nginx服务器日志相关指令主要有两条,一条是log_format,用来设置日志格式,另外一条是 ...
随机推荐
- Async/Await - Best Practices in Asynchronous Programming
https://msdn.microsoft.com/en-us/magazine/jj991977.aspx Figure 1 Summary of Asynchronous Programming ...
- lame边录音边转换
文章出处:http://big-joe.blog.sohu.com/88902836.html void CViewTFreqList::RecFileInit(LPCTSTR sFileName, ...
- Ret2Libc 练习(1) -- ZwSetInformationProcess
花了两个小半晚上的时间将0day安全这本书的绕过DEP的第一个实验做了,这里做些笔记. Ret2libc 我现在自己的理解就是在开启DEP保护的情况下,在程序的其他的可执行位置找到可以满足我利用要求的 ...
- HTML 表格
HTML 表格:表格由<table>标签来定义,行数由<tr>标签来定义,单元格由<td>标签来定义:<table border="1"& ...
- Nginx-Lua模块的执行顺序
一.nginx执行步骤 nginx在处理每一个用户请求时,都是按照若干个不同的阶段依次处理的,与配置文件上的顺序没有关系,详细内容可以阅读<深入理解nginx:模块开发与架构解析>这本书, ...
- C# 指定Webbrowser控件所用IE内核版本
如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容.解决方法是在注册表中为你的进程指定引用IE的版本号. 比如我的程序叫做a.exe,以64位机 ...
- net不安装Oracle11g客户端直接使用ODAC
好处: 1.不安装客户端也能访问服务器上的oracle(假设Application Server与DB Server 分开) 2.不需要安装ODAC 3.不需要配置TnsNames.Ora文件 缺点: ...
- .NET微信公众号开发-6.0模板消息
一.前言 为了保证用户不受到骚扰,在开发者出现需要主动提醒.通知用户时,才允许开发者在公众平台网站中模板消息库中选择模板,选择后获得模板ID,再根据模板 ID向用户主动推送提醒.通知消息.这个意思也就 ...
- lumen Response
1.基本响应 所有路由和控制器都会返回某种被发送到用户浏览器的响应,Lumen提供了多种不同的方式来返回响应,最基本的响应就是从路由或控制器返回一个简单的字符串: $app->get('/', ...
- 基于Bootstrap、Jquery的自适应导航栏
css代码: .kch_nav{width: 100%; position: fixed;z-index: 999;top:0;left: 0;right: 0;height: 69px;backgr ...