nginx-reverse-proxy

Why is my site not using http/2 while it is http/2 enabled

北城余情 提交于 2019-12-24 20:26:27
问题 I have a NGINX reverse proxy in front of a website. The NGINX server is http2/ready. If I run a test, all seems good: However, when I go to the website using a browser, chrome indicates the website is using http/1.1. I can't figure out why. Can anyone help? 回答1: I found out why. I enabled the TLS 1.3 protocol on NGINX. Chrome 70 on Win10 handshaked to TLS 1.3 without http/2. As soon as I disabled TLS 1.3 the browser handshaked to TLS1.2 + https/2. The question, of course, is what is faster. I

Nginx proxy on kubernetes

倖福魔咒の 提交于 2019-12-24 06:35:48
问题 I have a nginx deployment in k8s cluster which proxies my api/ calls like this: server { listen 80; location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html =404; } location /api { proxy_pass http://backend-dev/api; } } This works most of the time, however sometimes when api pods aren't ready, nginx fails with error: nginx: [emerg] host not found in upstream "backend-dev" in /etc/nginx/conf.d/default.conf:12 After couple of hours exploring

Grafana behind Nginx Reverse Proxy returns {{alert.title}}

寵の児 提交于 2019-12-23 06:01:09
问题 I'm trying to setup Grafana behind Nginx reverse proxy, but I have {{alert.title}} error every time I'm trying to lunch it over a browser. Grafana is running in docker container inside Kubernetes cluster with opened port 30000. Nginx is running inside VM with public IP. I can successfully curl url with Grafana from nginx VM. I don't have public DNS name assigned to my public IP yet, so I'm using public IP instead of DNS name in configs (but I also tried to use DNS name by adding correct

Using a Header to Filter Proxied Response Headers

孤者浪人 提交于 2019-12-19 11:53:46
问题 I have an upstream server that often sets Cookie(s) by returning the "Set-Cookie" response header. I would like to have an nginx proxy in front of said upstream server: Browser => Nginx => Upstream If the Browser => Nginx request had the header X-No-Cookies: true I'd like the response from Upstream => Nginx => Browser not to contain the Set-Cookie response header. If X-No-Cookies had any other value, I'd lie the Set-Cookie response header to be returned unaltered. I'm not able to change the

Nginx internal dns resolve issue

雨燕双飞 提交于 2019-12-11 19:53:32
问题 I have nginx container in AWS that does reverse proxy for my website e.g. https://example.com. I have backend services that automatically register in local DNS - aws.local (this is done by AWS ECS Auto-Discovery). The problem I have is that nginx is only resolving name to IP during start, so when service container is rebooted and gets new IP, nginx still tries old IP and I have "502 Bad Gateway" error. Here is a code that I am running: worker_processes 1; events { worker_connections 1024; }

Can't use nginx as websocket proxy

烈酒焚心 提交于 2019-12-11 14:53:39
问题 Here is my nginx config server { listen 80; server_name _; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://flask:8001; } location /socket.io { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy

How to configure nginx as proxy_pass?

天大地大妈咪最大 提交于 2019-12-11 08:49:20
问题 I have use Certbot Nginx to install my nginx to Ubuntu 18.04. I also use Certbot to get the LetsEncrypt certificate. I use basic configuration such as use tcp 80 and 433 so I can get both http and https. Most of the configuration done by Certbot. my domain is http://example.com and provides static page. Bu I also have a folder and I can call it with http://example.com/myfolder. After I install nginx I try to use proxy_pass and https to my local rest_api services. If I type http://127.0.0.1

Nginx bypass cache if upstream is up and use cache if down

妖精的绣舞 提交于 2019-12-11 06:19:53
问题 To bypass cache if upstream is up (max-age 1) and use cache if down (proxy_cache_use_stale) I created following config: proxy_cache_path /app/cache/ui levels=1:2 keys_zone=ui:10m max_size=1g inactive=30d; server { ... location /app/ui/config.json { proxy_cache ui; proxy_cache_valid 1d; proxy_ignore_headers Expires; proxy_hide_header Expires; proxy_hide_header Cache-Control; add_header Cache-Control "max-age=1, public"; proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;

Nginx case insensitive proxy_pass

血红的双手。 提交于 2019-12-10 23:51:58
问题 I've got a site called http://example.com , with an app running that can be accessed at http://example.com/app1 . The app1 is sitting behind an nginx reverse proxy, like so: location /app1/ { proxy_pass http://localhost:8080/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } Adding the trailing slash to the proxy_pass field lets me "remove" the /app1/ part of the URL, at

How to use nginx ingress TCP service on different namespace [duplicate]

感情迁移 提交于 2019-12-08 13:02:28
问题 This question already has an answer here : TCP ingress support in Kubernetes (1 answer) Closed 4 months ago . I have deployed two namespace in the kubernetes cluster. The namespace A host mysql and namespace B run postgress and expose their service deployment on these ports Namespace(A) - mysql - port (3306) Namespace(B) - postgress - port (5432) I need to use nginx-ingress kubernetes cluster to route the traffic based, here is the sample YAML file for the ingress apiVersion: extensions