Questions related to nginx location directive should use this tag.
Questions tagged [nginx-location]
1424 questions
4
votes
2 answers
Set custom 404 error page on nginx based on locale through url parameter
i'm running latest stable version of Nginx on GNU/Linux OS and having the following virtual host, i'm trying to setup custom localized 404 error pages avoiding if but i always end up in redirect loops.
By now, i'm only contemplating the following…

peris
- 943
- 3
- 20
- 33
4
votes
1 answer
Nginx: Rewrite Rules Not Working For Images
I'm getting tons of the below errors, all the errors are pointing to images that don't actually exist at the location that an error is being given, they are rewrites in Nginx that were converted from Apache.
All was working fine in Apache, it's just…

llanato
- 2,508
- 6
- 37
- 59
4
votes
1 answer
PHP File downloads if Nginx deny rule enabled
I've had an Nginx server running for over a year with no issues, it serves HTML and PHP files just fine for the Wordpress sites on it. Recently there was some brute force attacks on the wp-login.php so I decided to limit access to these areas by IP…

d1ch0t0my
- 443
- 7
- 22
4
votes
2 answers
How to set Nginx URI to fix empty URI in redirect to named location
The problem: when accessing our website with an invalid URL that contains a '%' sign, Nginx throws a 400 Bad Request error.
Instead of the Nginx page, we would like to rewrite the request to a (WordPress) 404 page.
I have tried the…

masa
- 2,762
- 3
- 21
- 32
4
votes
1 answer
How to use try_files with 2 or more roots
I have looked hi and low and found no such implementation and am wondering if what I am trying is even possible. I have 3 relative paths that serve up static content:
Path1: /usr/local/www/style1/static/...
Path2:…

DeJoker
- 82
- 8
4
votes
3 answers
Using nginx regex location matching to dynamically map URI's to different ports for multiple reverse proxies
I'm using nginx to create a reverse proxy to a web app that may be behind a firewall. For my initial proof of concept I used the following location block to ensure it worked.
location / {
proxy_pass https://localhost:2222;
…

0xtobit
- 1,091
- 12
- 14
4
votes
0 answers
Why could not Nginx location root be overridden (windows)?
I want to use video streaming with nginx for windows server. I have this nginx config:
#user nobody;
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
#pid …

sribin
- 1,736
- 1
- 13
- 21
3
votes
0 answers
how to print current value of a running uwsgi configuration options
I'm not sure why this question was not asked before. But I want to check current value of a running uwsgi configuration options, such as socket-timeout or uwsgi_read_timeout. The reason being is that by checking the current values, I can confirm the…

techie11
- 1,243
- 15
- 30
3
votes
1 answer
Nginx 404 not found
I am using docker compose for running nginx with latest version, using the volumes i am copying the nginx.conf files into nginx docker container
nginx:
image: nginx:1.20
container_name: nginx
ports:
- 80:80
restart:…

klee
- 1,554
- 2
- 19
- 31
3
votes
4 answers
How do I Run React App on Nginx with a node.js backend on AWS EC2?
I am trying to run a react app with Node.js backend on the Nginx server.
Here's my server block in the nginx.conf file:
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
listen [::]:80;
server_name _;
…

writeToBhuwan
- 3,233
- 11
- 39
- 67
3
votes
3 answers
How to get nginx to do a redirect to url-encoded query parameter
I have a requirement to do a proxy call to url delivered via a query parameter as per example:
My nginx proxy is deployed at: https://myproxy.net
if the redirect parameter is not url encoded I can do the call with this block:
location /basepath {
…

Zaak
- 482
- 11
- 25
3
votes
1 answer
Reverse proxy not passing query string to application
I created a rails app that is deployed into a subdirectory of my Vultr server. Somehow, no GET parameters are considered by the backend. For example, calls from the ForestAdmin API don't read GET parameters (see issue here). Also, my search page is…

nico_lrx
- 715
- 1
- 19
- 36
3
votes
1 answer
NGINX Run multiple application on same port with different route path
I have two applications, app1 is developed in reactJS and app2 in angularJS sharing same login session,
- Application 1
http://application-1:1234/
- APplication 2
http://application-2:2345/
My needs is to have a seemless navigation between both…

praveen2609
- 223
- 1
- 6
- 15
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
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