Questions tagged [nginx-reverse-proxy]

When a reverse proxy proxies a request, it sends the request to a specified proxied server (http or other), fetches the response, and sends it back to the client, as if it came from the reverse proxy itself.

More information: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

2738 questions
13
votes
2 answers

"If you're seeing this Grafana has failed to load its application files" Error with Docker Grafana deployment behind reverse proxy

I have been trying to get my Grafana container to work with my reverse proxy but have had no success. Everything i try just results in the "If you're seeing this Grafana has failed to load its application files" page appearing regardless of it I…
Spencer Skinner
  • 131
  • 1
  • 1
  • 4
13
votes
1 answer

nginx reverse proxy disable cache

i use nginx as a reverse proxy to connect a api. The problem is when i send a query after add or remove something. Nginx send me the old json value. I tried to disabled cache but it's not working. my nginx config: location / { sendfile off; …
Kévin Gaulin
  • 131
  • 1
  • 1
  • 4
12
votes
4 answers

Certbot failing acme-challenge (connection refused)

I'm trying to set up a Django project with docker + nginx following the tutorial Nginx and Let's Encrypt with Docker in Less Than 5 Minutes. The issue is when I run the script init-letsencrypt.sh I end up with failed challenges. Here is the content…
Johnny Beltran
  • 701
  • 2
  • 8
  • 22
12
votes
3 answers

NextJS behind proxy with URL Rewrite

Context: I've a NextJS deployment behind Nginx. The idea is to use NextJS to create several websites hosted in different domains. Each domain will have an entry in Nginx and it will be pointing to the specific path pages/cafes/[cafeId] in NextJS.…
sowdri
  • 2,193
  • 5
  • 23
  • 36
12
votes
4 answers

How to set Secure attribute to Set-cookie in Nginx through nginx.conf file

I am new to Nginx server. recently started working nginx project. I have task to set security headers through nginx.conf file. I set some header correctly but not able to set for Set-cookie. My requirement is, in response header Set-Cookie should…
12
votes
1 answer

NGINX: Limit the number of connections to an upstream server

I am using NGINX as a reverse proxy to an upstream server. Is there any way that I can limit the number of simultaneous connections NGINX establishes to the upstream server? The desired behaviour is: NGINX keeps a maximum of n connections to the…
Casper
  • 121
  • 1
  • 1
  • 4
11
votes
2 answers

How can I match any path containing a dot with nginx?

I am trying to implement a proxy using the nginx configuration The idea is to have a http server hosting my website (my SPA). and having one route on my http server pointing to another api. this is my nginw configuration file…
netlyonel
  • 155
  • 1
  • 2
  • 8
11
votes
2 answers

Error during WebSocket handshake: Unexpected response code: 301

I have already looked into the answer to RoR 5.0.0 ActionCable wss WebSocket handshake: Unexpected response code: 301 but it was not applicable to my case. I use an nginx-proxy as a front for several web-servers running in docker-containers. I use…
Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92
11
votes
2 answers

nginx how to get the request client ipaddress

I have ngnix proxying to a nodejs server. I am trying to read the request client ip address/host name in my nodejs, but it's always ::ffff:127.0.0.1 But in my nginx access log, I can see the client ip address printed, not sure why my nodejs server…
PMat
  • 2,039
  • 2
  • 29
  • 46
10
votes
2 answers

Nginx HTTP not redirecting to HTTPS 400 Bad Request "The plain HTTP request was sent to HTTPS port"

I'm running nginx in docker. HTTPS works fine but when I explicitly make HTTP request I get the following error 400 Bad Request The plain HTTP request was sent to HTTPS port nginx.conf is as follows worker_processes auto ; events {} http…
Omair Nabiel
  • 1,662
  • 2
  • 12
  • 24
9
votes
3 answers

Nginx: Get the upstream URI used by proxy_pass

I am using proxy_pass and would like to log the URI used by proxy_pass. I can log every detail like $upstream_addr (IP) of the process except the URI itself. Am I missing something or this is not possible?
Railsana
  • 1,813
  • 2
  • 21
  • 30
9
votes
2 answers

nginx 431 Request Header Fields Too Large

Recently, the size of data in our cookies has become larger, and all of the requests that go through nginx started getting rejected with 431 error responses. I tried increasing the large_client_header_buffers and client_header_buffer_size to no…
Evan Morrison
  • 652
  • 6
  • 18
9
votes
0 answers

Using variable in nginx conf

This works in my Nginx config: # This works proxy_pass http://GitLab-CE:9080; ... but this does not: # does not work set $upstream_gitlab GitLab-CE; proxy_pass http://$upstream_gitlab:9080; This was copied from a different…
eric.frederich
  • 1,598
  • 4
  • 17
  • 30
9
votes
2 answers

Hosting webapp with relative URLs behind Kubernetes NGINX ingress controller

I am hosting a web application inside a Kubernetes 1.13 cluster behind an NGINX ingress controller. The Ingress specifies path: /my-webapp/?(.*) and annotations: { nginx.ingress.kubernetes.io/rewrite-target: /$1 } such that the webapp can be reached…
rookie099
  • 2,201
  • 2
  • 26
  • 52
8
votes
0 answers

Nginx(as reverse proxy) does not notify gin-gonic(as web server) when connection canceled by client

In a website which uses gin-gonic as webserver and nginx as a proxy server, clients send their data to the server via gin-gonic exposed APIs, and — in order to send server commands to clients — each one(i.e client) has a connection to the web server…
Bonje Fir
  • 787
  • 8
  • 25