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,用来设置日志格式,另外一条是 ...
随机推荐
- [THINKING IN JAVA]访问权限控制
6 访问权限控制 6.1 包:库单元 package.import.import *.import static: 修改classpath环境变量可以将自己写的类库添加至环境变量并在任何java程序中 ...
- 【ZOJ1003】Crashing Balloon(DFS)
Crashing Balloon Time Limit: 2 Seconds Memory Limit: 65536 KB On every June 1st, the Children's ...
- CSRF攻击
1.什么是CSRF攻击CSRF(Cross-site request forgery),跨站请求伪造.CSRF攻击的原理如下:1)用户登录正常的网站A后,在本地生成Cookie2)在不登出A的情况下, ...
- 拜拜了,浮动布局-基于display:inline-block的列表布局
原创文章,转载请注明来自张鑫旭-鑫空间-鑫生活[http://www.zhangxinxu.com]本文地址:http://www.zhangxinxu.com/wordpress/?p=1194
- Weblogic是瓦特?和JVM是瓦特关系?
所谓固定内存60M是瓦特? 以下内容是个瓦特? “总内存大小=堆内存+非堆内存1200m:为堆内存大小,如果不指定后者参数则有最大数限制,网上很多文章认为这就是JVM内存,-Xmx为设置最大堆内存60 ...
- zabbix3.0安装之图形界面显示异常【server】
前面记录过Zabbix3.0的安装过程,遇到一些坑,当时就在博文最后提到过,显示界面只有文字没有样式的问题.今天就解决这个小问题. 首先, 我们的安装是基于nginx作为web服务器的,不是传统的用A ...
- Eclipse 开发 jsp
下载 eclipse EE 注意 是eclipse EE 版本 下载 apache-tomcat-8.0.15 只下载上面二个 从Window -> Preferences -> S ...
- AspNetPager控件报错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$Aspnetpager1_input问题解决[摘]
高版本IE,如IE10或者IE11在浏览页面时出现错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$ ...
- 01 Linux入门介绍
一.Linux 初步介绍 Linux的优点 免费的,开源的 支持多线程,多用户 安全性好 对内存和文件管理优越 系统稳定 消耗资源少 Linux的缺点 操作相对困难 一些专业软件以及游戏支持度不足 L ...
- 《Javascript高级程序设计第3版》精华总结
一.JavaScript简介 1.1 javascript简史 1.2 javascript实现 + javascript是一种专为网页交互而设计的一种脚本语言,javascript由三大部分组成 ...