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,用来设置日志格式,另外一条是 ...
随机推荐
- python操作
用python做OI题实在不是一个明智的选择 if __name__ == "__main__":相当于c艹的int main(),然而似乎没有也可以? 重定向标准输入输出流:sy ...
- WingIDE中文乱码问题解决方法
WingIDE中文乱码问题解决方法 安装完WingIDE后,首次运行python脚本时,若脚本中含有UTF-8中文,在Debug I/O输出框中,全部变成了乱码. 这时其实我们设置下WingIDE的编 ...
- CSS盒子模型的一些理解
盒子模型相当于把现实中的盒子形象化. 盒子模型的大小="内容(content)+内填充(padding)+边框(border)+外边距(margin)" 盒子模型方向为:top, ...
- Window memcache 使用
一.memcache配置 1. 下载memcache 32位系统 1.2.5版本:http://static.runoob.com/download/memcached-1.2.5-win32-bin ...
- Windows 2008 R2 强制删除Cluster
在正常删除Cluster 节点之后,再添加节点时,报“节点已经加入群集”,无法加入,注册表信息删除后可正常移除Cluster服务,如下: HKEY_LOCAL_MACHINE\SYSTEM\Curre ...
- Adaptive Decontamination of the Training Set: A Unified Formulation for Discriminative Visual Tracking
Martin Danelljan 判决类追踪模型是由训练样本学习得到,但是为了适应目标和背景的变化sample set在每一帧中都会更新. 令(xjk, yjk)表示第k帧k={1,2,...,t}中 ...
- PHPWord
PHPWord中文乱码 我在 使用PHPWord$section->addText(),输出中文是遇到乱码,PHPWord 中文乱码解决如下: 第一步:打开phpword/Section.php ...
- 在Ubuntu14.04系统POWER8服务器上搭建Docker Registry服务
本文描述了如何在POWER8服务器上搭建一个本地化的Docker镜像仓库,主要涉及镜像制作,Docker Registry服务启动等.希望能够对在非X86服务器上搭建Docker仓库的同学提供参考. ...
- 拥有的50个CSS代码片段(上)
1. CSS 重置 ;;;font-size: 100%; font: inherit; vertical-align: baseline; outline: none; -webkit-box-si ...
- [I2C]I2C总线协议图解
转自:http://blog.csdn.net/w89436838/article/details/38660631 1 I2C总线物理拓扑结构 I2C 总线在物理连接上非常简单,分别由S ...