Questions tagged [nginx-config]
2020 questions
3
votes
1 answer
Assign the Lua function to Nginx variable
I would like to assign the value to the nginx variable.
This is my sample code.
location / {
set $TOKEN;
content_by_lua_block {
result = io.popen("echo 'https://google.com'") # or any command that will return value to result
…

zzob
- 993
- 3
- 9
- 19
3
votes
1 answer
Display remote user retrieved from auth_request in access logs in Nginx
I have the following configuration in nginx:
location /api/ {
auth_request /auth/request/;
auth_request_set $user $upstream_http_remote_user;
proxy_set_header Remote-User $user;
proxy_pass http://...;
…

hanego
- 1,595
- 1
- 14
- 27
3
votes
1 answer
Nginx : blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values
I needs to enable cors policy to reach to my api, i did the following configuration on my nginx server file:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name api.domain.com;
location / {
…

Christophe
- 145
- 1
- 1
- 12
3
votes
0 answers
Nginx “400 Request Header Or Cookie Too Large” problem
I am getting a 400 Bad Request request header or cookie too large from nginx with my springboot app, because the JWT key is 38.7kb.When I use a smaller JWT key,everything is fine. I try to modify the nginx's configuration by add this in the server…

Xiao Liu
- 31
- 1
- 3
3
votes
0 answers
how to add global constants in nginx config?
Is it possible to define a global constant variable in the nginx config file?
I would like to define a constant for an IP Address, as it's used in multiple location blocks - see below:
location / {
satisfy all;
allow…

vgoklani
- 10,685
- 16
- 63
- 101
3
votes
1 answer
Istio Ingress routing fails with 404 for Nginx/Angular app
I am deploying Nginx with angular app behind istio ingress gateway.
Expected result: https://tremend.com/tremendui/ should open the app.
Issue: But after accessing the url https://tremend.com/tremendui/, it reaches till index.html, but it fails to…

justin xa
- 105
- 1
- 11
3
votes
0 answers
NGINX Timeout on proxy_pass timeout because of DNS change
So I have the following proxy_pass:
server {
listen server:443 ssl;
server_name test.test.com;
location /api/testapi/v1/users
proxy_connection_timeout 120;
proxy_pass https://api.test.com/testapi/v1/users
}
I've noticed that out of the…

Frank Mancini
- 147
- 4
3
votes
1 answer
Ngnix laravel docker project return error 502 bad gateway
I tried run laravel inside docker container with ngnix.
Directory structure:
File docker-compose.yml:
version: '3'
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
ports:
- "${HOST_PORT}:80"
…

Andreas Hunter
- 4,504
- 11
- 65
- 125
3
votes
1 answer
SPA applications (Vue, React, Angular) not working properly behind Nginx ingress controller on Kubernetes
We are using AKS (Azure Kubernetes Service) for managed Kubernetes clusters and for the biggest part we are happy with the benefit the platform brings but we face some issues as well.
On AKS if you host a service of LoadBalancer type it…

Ruslan Filipov
- 33
- 4
3
votes
1 answer
How to choose the right ciphers for NGINX config
I'm new to nginx and I just recently decided to make a change to the config file to redirect my applications from http to https using the return statement return 301 https://$host$request_uri;. This all worked fine until I noticed that we weren't…

Michael
- 1,454
- 3
- 19
- 45
3
votes
1 answer
Ingress session-cookie-path setting regular express in Ingress Session Cookie; resulting in user logout
I have created an ingress controller configuration with following path definitions:
paths:
- path: (USA)/my-app/(.*)$
...............
- path: (UK)/my-app/(.*)$
The problem happening here is when I don't set the following…

Jaraws
- 581
- 1
- 7
- 24
3
votes
1 answer
nginx regex engine on URL rewrite doesn't support squiggly brackets?
My nginx config seems to fail on the syntax check if I try to use the squiggly brackets, even though this answer implies that nginx uses PECR, and this fiddle shows that the squiggly brackets work under PECR (although it does say PECR PHP in…

Digital Ninja
- 3,415
- 5
- 26
- 51
3
votes
1 answer
Nginx default error page is still showing
I added custom error page to Nginx by these lines:
error_page 400 /custom.html;
location = /custom.html {
root /somewhere/html;
internal;
}
location /test {
return 400;
}
It returns my custom error page for test location; The problem is for…

Amir
- 341
- 1
- 5
- 16
3
votes
0 answers
Max retries exceeded with url, Failed to establish a new connect [Errno 60] Operation timed out'
I used nginx to build mlflow server with its proxy_pass and integrated simple HTTP auth in nginx. However, when I ran the experiment for a while, the mlflow client met this exception. And I have no idea how to fix it.
Here is the error…

Jie-Han Chen
- 108
- 1
- 8
3
votes
1 answer
Nginx Rate limit GET or POST requests only at a location
I have a server in nginx configured and have the following code to create my rate limit zone:
limit_req_zone $key zone=six_zone:10m rate=60r/m;
In my location, I use a module to serve the requests. This location supports GET, POST and DELETE…

whiplash
- 695
- 5
- 20