nginx

NGINX TLS termination for PostgreSQL

你。 提交于 2020-12-09 09:54:40
问题 I’ve been trying to use NGINX as a TLS terminator for my PostgreSQL database but without success. When I try to connect to the database I get the following error: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. When I remove the ssl option in listen I can connect without any errors. I’ve tried running another service(Eclipse Mosquitto) with the same NGINX settings, TLS enabled, and it works fine. I’m using

nginx配置解决vue单页面打包文件大,首次加载慢的问题

喜夏-厌秋 提交于 2020-12-09 02:04:23
nginx配置解决vue单页面打包文件大,首次加载慢的问题 参考文章: (1)nginx配置解决vue单页面打包文件大,首次加载慢的问题 (2)https://www.cnblogs.com/goloving/p/9170269.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/3797416/blog/4782868

灰度发布浅析

╄→尐↘猪︶ㄣ 提交于 2020-12-08 09:57:25
定义 灰度发布就是已一种平滑过渡的方式来发布,通过切换线上新旧版本之间的路由权重,逐步从旧版本切换到新版本;比如要上线新功能,首先只是更新少量的服务节点,通过路由权重,让少部分用户体验新版本,如果没有什么问题,再更新所有服务节点;这样可以在出现问题把影响面降到最低,保证了系统的稳定性。 灰度发布 一个系统往往有接入层比如nginx(Openresty),网关层比如zuul,以及服务层比如各种rpc框架;在这几层都有路由功能,也就是说这几层都可以做灰度;接入层可以使用nginx+lua来实现灰度,网关层zuul可以结合ribbon来实现灰度,rpc框架如dubbo本身提供了路由功能可以直接做灰度处理;下面看看具体如何去实现; 接入层灰度 接入层我们这里使用功能更强大的Openresty,然后使用lua进行路由转发,相关的路由策略可以配置在分布式缓存redis里面,当然也可以持久化到数据库里面; 准备 准备一台Openresty,两台web服务器tomcat(端口分别是8081,8082),以及redis;为了方便模拟在redis里面配置白名单,如果在白名单里面就走8082,不在则走8081; Openresty配置 需要在Openresty中配置支持lua,以及相关路由的lua脚本,nginx.conf配置如下: http { ... lua_package_path "

Nginx url limit 502 gateway

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-08 07:24:21
问题 I have a question but I accept other suggestions that bypass this feature. Basically I'm sending big lines of text ~3000 characters to my server in a get request and the server sends it to google translate as params in a url. The problem: Nginx throws me a 502 bad gateway error when the url is > 1900 characters. How can I increase the limit of my nginx url? Alternative Solution: Sending a post request with the 3000 characters in a JSON as a string? 回答1: To answer your question, there is a

Nginx url limit 502 gateway

谁说胖子不能爱 提交于 2020-12-08 07:22:27
问题 I have a question but I accept other suggestions that bypass this feature. Basically I'm sending big lines of text ~3000 characters to my server in a get request and the server sends it to google translate as params in a url. The problem: Nginx throws me a 502 bad gateway error when the url is > 1900 characters. How can I increase the limit of my nginx url? Alternative Solution: Sending a post request with the 3000 characters in a JSON as a string? 回答1: To answer your question, there is a

NGINX controller Kubernetes: need to change Host header within ingress

独自空忆成欢 提交于 2020-12-08 04:30:43
问题 Scenario I'm running NGINX and Kubernetes. I need to configure NGINX so that it sets or overrides the Host header Host: minio:9000 to a pod so that the Pod will always service requests thinking that it's hosting as minio:9000 no matter where the request is coming from. I believe the recommended approach is to use NGINX and modify the ingress annotations of that Pod (maybe I'm wrong). How I currently set it up I instead my nginx controller with helm via this guide https://kubernetes.github.io

Centos7安装Nginx实战

情到浓时终转凉″ 提交于 2020-12-07 16:38:37
一、背景    最近在写一些自己的项目,用到了nginx,所以自己动手来在Centos7上安装nginx,以下是安装步骤。 二、基本概念以及应用场景 1.什么是nginx   Nginx是一款使用C语言开发的高性能的http 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。由俄罗斯的程序设计师Igor Sysoev所开发,官方测试nginx能够支支撑5万并发链接,并且cpu、内存等资源消耗却非常低,运行非常稳定。 2.Nginx的应用场景  (1).http服务器。Nginx是一个http服务可以独立提供http服务。可以做网页静态服务器。  (2).虚拟主机。可以实现在一台服务器虚拟出多个网站。例如个人网站使用的虚拟主机。  (3).反向代理,负载均衡。当网站的访问量达到一定程度后,单台服务器不能满足用户的请求时,需要用多台服务器集群可以使用nginx做反向代理。并且多台服务器可以平均分担负载,不会因为某台服务器负载高宕机而某台服务器闲置的情况。 三、安装步骤 1.检查并安装所需的依赖软件  (1).gcc:nginx编译依赖gcc环境    安装命令:yum install gcc-c++  (2).pcre:(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库

nginx config file not updating after reload

孤人 提交于 2020-12-07 10:11:30
问题 I have a list of rewrite redirects in my nginx config file. There is one redirect that I'm trying to remove without any joy: rewrite ^/bla/screening-tools$ /bla permanent; I've tried simply removing this line, and then running sudo nginx -s reload However it is still there. I've tried leaving it in and then rewriting it once more at the end: rewrite ^/bla/screening-tools$ /bla/screening-tools permanent; However once more after reloading nginx this still has no effect. Am I missing something

nginx config file not updating after reload

不羁岁月 提交于 2020-12-07 10:09:48
问题 I have a list of rewrite redirects in my nginx config file. There is one redirect that I'm trying to remove without any joy: rewrite ^/bla/screening-tools$ /bla permanent; I've tried simply removing this line, and then running sudo nginx -s reload However it is still there. I've tried leaving it in and then rewriting it once more at the end: rewrite ^/bla/screening-tools$ /bla/screening-tools permanent; However once more after reloading nginx this still has no effect. Am I missing something

How to restore original client IP from Cloudflare with NGINX ingress controller

一曲冷凌霜 提交于 2020-12-07 05:04:20
问题 I'm using Cloudflare as CDN and it's hiding the real IP address for the clients I'm using an NGINX ingress controller as a loadbalancer running in Google Kubernetes engine So I'm trying to restore the original IP address and trying to follow this link https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx- How can I implement this in the configmap for my Nginx ingress since I need multiple value for the same key "set-real-ip-from" ?