nginx

nginx location and Django auth

﹥>﹥吖頭↗ 提交于 2021-01-01 07:39:45
问题 I'm trying to create a NGINX redirect based on an URL param in the querystring. Basically having: http://localhost/redirect/?url=https://www.google.it/search?dcr=0&source=hp&q=django&oq=django and location /redirect/ { proxy_cache STATIC; # cache status code 200 responses for 10 minutes proxy_cache_valid 200 1d; proxy_cache_revalidate on; proxy_cache_min_uses 3; # use the cache if there's a error on app server or it's updating from another request proxy_cache_use_stale error timeout updating

nginx location and Django auth

青春壹個敷衍的年華 提交于 2021-01-01 07:39:24
问题 I'm trying to create a NGINX redirect based on an URL param in the querystring. Basically having: http://localhost/redirect/?url=https://www.google.it/search?dcr=0&source=hp&q=django&oq=django and location /redirect/ { proxy_cache STATIC; # cache status code 200 responses for 10 minutes proxy_cache_valid 200 1d; proxy_cache_revalidate on; proxy_cache_min_uses 3; # use the cache if there's a error on app server or it's updating from another request proxy_cache_use_stale error timeout updating

Keepalived高可用集群

落爺英雄遲暮 提交于 2021-01-01 07:38:53
Keepalived高可用集群 Keepalived介绍 Keepalived软件起初是专门为LVS负载均衡软件设计的,用来管理并监控LVS集群系统中各个服务节点的状态,后来又加入了可以实现高可用的VRRP功能。因此,Keepalived除了能够管理LVS软件外,还可以作为其他服务(例如:Nginx,Haproxy,MySQL等)的高可用解决方案软件。 Keepalived软件主要是通过VRRP协议实现高可用功能的。VRRP是Virtual Router Redundancy Protocol(虚拟路由器冗余协议)的缩写,VRRP出现的目的就是为了解决静态路由单点故障问题的,他能够保证当个别节点宕机时,整个网络可以不间断地运行。所以,Keepalived一方面具有配置管理LVS的功能,同时还具有对LVS下面节点进行健康检查的功能,另一方面也可实现系统网络服务的高可用功能。 Keepalived软件的官方站点是 http://www.keepalived.org Keepalived服务的三个重要功能 (1)管理LVS负载均衡软件 早期的LVS软件,需要通过命令行或脚本实现管理,并且没有针对LVS节点的健康检查功能。为了解决LVS的这些使用不便问题,Keepalived诞生了,可以说,Keepalived软件起初是专为解决LVS的问题而诞生的。因此

Jenkins出现No valid crumb was included in the reques

半腔热情 提交于 2021-01-01 06:43:32
前提 今天登陆Jenkins时,觉得使用tomcat默认的8080端口麻烦,便使用Nginx做了一个反向代理。于是出现了以下错误 1. 问题描述 Jenkins配置好ssh server点击保存时出现如下错误: 2. 原因 Jenkins在http请求头部中放置了一个名为.crumb的token。在使用反向代理时, 如果Jenkins设置中勾选了“Prevent Cross Site Request Forgery exploits”, 代理服务器会认为.crumb为非法头部而去掉,导致跳转失败。 3. 解决方式 1. 在反向代理服务器Nginx中设置ignore_invaild_headers 在nginx server配置段中添加如下内容: server { ignore_invalid_headers off; } 2. 在Jenkins全局安全设置中取消勾选“Prevent Cross Site Request Forgery exploits”,如下图: 来源: oschina 链接: https://my.oschina.net/u/4397718/blog/4872575

NGINX Reverse Proxy + ngx_upstream_resolveMK - Trying to resolve SRV from ECS Service Discovery Route53 Auto Naming

我们两清 提交于 2021-01-01 06:38:54
问题 I'm currently having an issue with ECS Service Discovery and Route53 Auto Naming. I have added the Service Registry to the service and all the Hosted Zones records are being populated automatically. But I cannot seem to work out how to resolve the DNS SRV records with NGINX + ngx_upstream_resolveMK. # DNS RESOLVER resolver ns-x.awsdns-xx.com valid=10s; # UPSTREAMS upstream kibana { resolveMK servicediscovery.ecs service=kibana; } # HOST - kibana.example.com server { server_name kibana.example

nginx +location + https

青春壹個敷衍的年華 提交于 2021-01-01 06:38:48
wget http://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.14.0-1.el6.ngx.x86_64.rpm (下载nginxRPM管理包) rpm -ivh nginx-1.14.0-1.el6.ngx.x86_64.rpm (安装nginx) 开始实验: /etc/nginx/ ├── conf.d (拓展文件) │ ├── abc.conf │ ├── default.conf │ ├── efg.conf │ └── error.conf ├── fastcgi_params ├── koi-utf ├── koi-win ├── mime.types ├── modules -> ../../usr/lib64/nginx/modules ├── nginx.conf (主配文件) ├── scgi_params ├── uwsgi_params └── win-utf /usr/share/nginx/html/ (数据文件) ├── 50x.html ├── abc │ └── index.html ├── efg │ └── index.html ├── error │ └── index.html └── index.html **# 基于虚拟主机的两个网站** [root@localhost conf.d

NGINX Reverse Proxy + ngx_upstream_resolveMK - Trying to resolve SRV from ECS Service Discovery Route53 Auto Naming

依然范特西╮ 提交于 2021-01-01 06:37:19
问题 I'm currently having an issue with ECS Service Discovery and Route53 Auto Naming. I have added the Service Registry to the service and all the Hosted Zones records are being populated automatically. But I cannot seem to work out how to resolve the DNS SRV records with NGINX + ngx_upstream_resolveMK. # DNS RESOLVER resolver ns-x.awsdns-xx.com valid=10s; # UPSTREAMS upstream kibana { resolveMK servicediscovery.ecs service=kibana; } # HOST - kibana.example.com server { server_name kibana.example

Nginx防盗链、Nginx访问控制、Nginx解析php相关配置、Nginx代理

血红的双手。 提交于 2021-01-01 06:34:59
Nginx防盗链首先进入到/usr/local/nginx/conf/vhost/目录下,编辑配置文件 vim test.com.confvim test.com.conf然后如数如下内容location ~ ^.+.(gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls)${ expires 7d; valid_referers none blocked server_names .test.com ; if ($invalid_referer) { return 403; } access_log off;} valid_referers none blocked server_names *.test.com ; if ($invalid_referer) { return 403;这时防盗链的核心部分,第一行的意义为定义白名单,第二行是如果不匹配,第三行是状态码。输入完后保存,检查语法,重新加载。 Nginx访问控制 和httpd一样,Nginx也需要限制某些IP不能访问或者只允许某些IP访问,配制方法和httpd很像。但更加简洁了。不需要像httpd全部都历一遍。 配置访问控制还是要编辑虚拟主机的配置文件 /usr/local/nginx/conf/vhost/ 然后再最后面加上访问控制的配置 location

How to convert an nginx reverse proxy “sub_filter” to IIS10 URL Rewrite - Outbound Rule?

老子叫甜甜 提交于 2021-01-01 06:09:38
问题 I'm currently using nginx (for Windows) to create the below reverse proxy with respective sub_filter to inject CSS to the HTML. I would like to replicate this in IIS 10: location /files { proxy_pass http://localhost:999/files; proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; sub_filter '</head>' ' <link rel="stylesheet" type="text/css" href="https://github.io/test/CSS/themes/dark.css"> <style>

How to convert an nginx reverse proxy “sub_filter” to IIS10 URL Rewrite - Outbound Rule?

人盡茶涼 提交于 2021-01-01 06:06:02
问题 I'm currently using nginx (for Windows) to create the below reverse proxy with respective sub_filter to inject CSS to the HTML. I would like to replicate this in IIS 10: location /files { proxy_pass http://localhost:999/files; proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; sub_filter '</head>' ' <link rel="stylesheet" type="text/css" href="https://github.io/test/CSS/themes/dark.css"> <style>