Questions tagged [nginx-location]
Questions related to nginx location directive should use this tag.
1,430
questions
0
votes
1
answer
14
views
NGINX configuration location for following hierarchy of directories
I was wondering whether the following location would work in NGINX
Configuration:
location ~ ^/(uk|us|de)/?(.*)? {
proxy_pass http://127.0.0.1:3000/$1/$2;
proxy_cache off;
...
0
votes
0
answers
17
views
Nginx proxy_pass without path
I'm configuring an Nginx reverse proxy that should do the following:
/ => proxied to http://server:8080/api/resolver
/somepath1 => proxied to http://server:8080/api/resolver (should drop the ...
1
vote
0
answers
18
views
Nginx detects the request's IP incorrectly from some users
When checking the access log of Nginx, I see that the IP of my friend's device is detected incorrectly. But Nginx still detects my IP correctly even when I try to change the other network.
For example,...
0
votes
0
answers
14
views
The 'Custom locations' dose not work as expected with Jellyfin
Describe the bug
I set up the Nginx Proxy Manager with my local NAS using this Docker compose file:
version: '3.9'
services:
app:
image: jc21/nginx-proxy-manager:latest
restart: unless-...
0
votes
0
answers
16
views
Nginx reverse proxy without port
I have project running on nginx and through nginx I am presenting this project to the UI with a domain of ssl. It broadcasts from port 443 with example.com. I publish my project, which is a different ...
0
votes
0
answers
20
views
NGINX server: save custom error pages in own folder
I'm setting up a new nginx server and in most tutorials the people just drop their custom error pages into the project folder. I wanted to collect them in an own folder, so it is easier to manage if ...
0
votes
0
answers
13
views
Problem in changing root path nginx configuration
I have a problem with nginx configuration. I need logic that sets the root folder for static pages based on cookies set based on location. After the first redirect to / from /test1 and setting the ...
0
votes
0
answers
39
views
Jellyfin with NGinx Proxt Manager
I am running a jellyfin instance on my local IP HTTP://192.168.0.98:8096 and I am trying to make it work via Nginx Manager with a custom location of /jellyin
My configuration so far:
This is my main ...
0
votes
1
answer
20
views
allow .bin extension for specific folder and it's subfolders - NGINX
I need to allow .bin extension in specific folder on my server (NGINX)
I have tried to add code below to /etc/nginx/sites-available/domain.com
location /PUZZL/ {
root /var/www/DOMAIN.com/htdocs;
...
0
votes
0
answers
23
views
Matching every URL which is like /?= followed by a number
I need to match all URLs which are similar to domain.com/?= followed by some random numbers like domain.com/?=123123.
I'm trying this regex which is not working in nginx /?=[0-9]* it some equivalent ...
0
votes
0
answers
18
views
Nginx: Retrieve HTTP Status of a Specific Location via URI Parameter
I have a requirement where I want Nginx, upon accessing the /check location and passing a URI to it, to reach the specified location within the same configuration and return the HTTP status of that ...
0
votes
0
answers
26
views
Nginx configuration issue: Node.js app works with location / but not with location /nodeapp
I have a dockerized nginx server and a dockerized nodejs app.
When I run the nodejs app and expose its port 3000 on my localhost, it works perfectly when I access it at localhost:3000.
Now, I want to ...
0
votes
0
answers
34
views
Nginx does not match exact location
I have a single page app that i'd like to serve from nginx, but i have an issue with its separate ldap (login form post) path:
location = /ldap {
set $stuff $stuff'1';
proxy_pass ${...
0
votes
1
answer
25
views
Nginx try_files directive doesn't serve the specified files
I know there is lots of similar posts out there but still couldn't find the one fits my case.
I have very simple location block which serves static html file but it serve 404 not the file i specified.
...
0
votes
1
answer
31
views
Nginx location with proxy_pass not working
I'm doing the given request http://example.com/my/route/bar, the request body has 5M, so want to use client_max_body_size 0M for the route /my/route/*. But I'm having trouble making nginx use my ...
0
votes
0
answers
34
views
How to configure Nginx to use another HTTP proxy server for some locations
I am using Nginx as a reverse proxy server, where I receive request from Client, reverse-proxy serves it and return back to client, reverse proxy does not have access to public internet and have to ...
0
votes
1
answer
40
views
use regex for detect multi string in nginx location and rewrite
I want when a request is sent to the server and there is one of the string values of (movie|series|video|...) at the beginning, that string is removed and directed to the path where the data is stored....
0
votes
0
answers
19
views
Nginx - Nest Regex Location with a Fallback
I have an API that is reversed proxied through Nginx,
I'm trying to harden it so that only known paths are allowed, and add to each its own rate limit.
When nesting regex locations, the nesting ...
0
votes
1
answer
43
views
Setup NGINX to serve to static site on the same domain
When i use this nginx configuration separately - sites open normally
server {
server_name mysite.com;
root /myblog;
index index.html;
location / {
try_files $uri $uri/ =404;
...
0
votes
1
answer
19
views
static files not found error in nginix after a correct path mentiond
server {
listen 443 ssl; # Listen on port 443 for HTTPS traffic
server_name 54.198.4.208; # Replace with your actual domain name or IP address
# SSL/TLS Certificate Configuration
ssl_certificate /etc/...
0
votes
1
answer
33
views
How to get a file from URL when there is no local file with `try_files` in nginx.conf?
Suppose you have a request for the following json file.
https://example.com/static/xxx/fileName.json
I would like to know how to get a file from a URL when there is no local file. It looks like I can ...
0
votes
0
answers
20
views
NGINX log_format Directive Not Working When Configuration Split into Multiple Files
I've been trying to break my NGINX configuration into multiple files for easier management and maintainability. However, after splitting the files, my custom log_format directive doesn't seem to work. ...
0
votes
0
answers
17
views
Angular and .net core application hosing in nginx
We have create an Angular + .net core applicaiton using the template in visual studio.
This has been built and publihed in fasthosts under nginx.
browings to https://www.example.com works perfectly. ...
1
vote
1
answer
31
views
nginx location block configuration
i'm trying to serve files of specific urls from a subfolder of my webserver, matching the url with the location config of nginx, it works for the first level "/newsletter" but not for the ...
0
votes
0
answers
12
views
NGINX - Multiple Subdomains to Log In To phpMyAdmin
I'm trying to have 2 separate subdomains from 2 different websites have access to logging into the same phpMyAdmin.
I'm not sure how to set up the phpmyadmin.conf file so that NGINX knows how to ...
0
votes
0
answers
13
views
How can i configure reverse proxy with nginx with Subdomains
I need some help.
let me show my case.
I have 1 nginx with one external domain
testeapps.com
and i need to put any subdomais with proxy pass after the .com
For example.
testeapps.com/api
proxy_pass -&...
0
votes
0
answers
71
views
Problem with React BrowserRouter inside Drupal site
I have a Drupal 10 site with one page at the following URL: localhost:9090/my-page. On that page, I have a Drupal block that includes a React app with its own Browser Router.
React BrowserRouter ...
1
vote
0
answers
41
views
Nginx stub status global or per server block?
I want to enable the http_stub_status module in nginx.
I have multiple server {} blocks in my nginx.conf, for different applications.
What it is not clear to me from the nginx documentation is are ...
0
votes
0
answers
28
views
How to return the response Body of the server response instead of Nginx defaulte Error page
Here is my nginx conf file, I want to where /test is what the route is, where I want to test the authentication first, then proceed.
But when /auth/ responds with some 401 error code and a json body, ...
0
votes
0
answers
14
views
Nginx will not reroute me correctly
I have problems getting my nginx routing problem fixed when using some Docker container that should be reouted by a nginx server
I have opened port 80 for the nginx container and 3 other docker ...
0
votes
0
answers
24
views
Error Restarting Nginx : unknown log format "payload" in /etc/nginx/sites-enabled/default:57
1.Im trying to copy some files from a server then transfer it into other server using nginx. Before I make configurations, nginx can ran smoothly.
I can download the files which are:
sites-available ...
0
votes
1
answer
117
views
Nginx - How to get the count of requests handled by each upstream IP in the upstream block?
upstream test {
server ip1:port1;
server ip1:port2;
server ip1:port3;
server ip1:port4;
}
location / {
set $dst test;
proxy_pass http://$dst;
}
Approach -
Initially in the ...
0
votes
1
answer
59
views
Nginx doesn't forward response headers
I have a .Net 6 application that for the following request returns a response as below. Please note there is a Access-Control-Allow-Origin present:
$ curl -i http://localhost:5081/Artworks/IMG_9346m....
0
votes
0
answers
13
views
I want to configur nginx to open the two projects on one domain with different urls
I have a project hosted on blog.example.com and another project on example.com. Both are multilingual projects by first URL segment e.g. blog.example.com/fr/foo/bar and example.com/fr/foo/bar but for ...
2
votes
1
answer
245
views
Nginx: access upstream response header in the mirror block
My mirroring works just fine, and I am correctly getting the original request body in the mirror server.
However I need to access a response header called Location from the original upstream and ...
0
votes
0
answers
34
views
nginx /health endpoint without index.h
I'm trying to add a /health endpoint to a nginx server using the following config file
server {
listen 8080 default_server;
location /health {
access_log off;
return 200;
}...
0
votes
0
answers
23
views
Can an nginx location directive match the entire url?
I have nginx set up on my server, but am still fairly new to nginx. I am curious if a location directive can match the entire url (eg http://myserver.com/mypage - not just /mypage). I see the ...
0
votes
0
answers
16
views
Unable to load images in error page using nginx
My goal is to display a static message for all the application URI path whenever I start nginx.
Below is my location block and it works fine when I use the URL https://localhost:5443/abc/def
...
0
votes
0
answers
73
views
Setting Up Nginx as a Reverse Proxy Server doesn't work
I'm trying to set up nginx as a reverse proxy for this simple node.js script
const http = require('http');
const hostname = 'localhost';
const port = 3000;
const server = http.createServer((req, ...
0
votes
0
answers
188
views
Nginx throws 400 error when client sent duplicate header
From Client, nginx receives Authorization header twice with different values in same request. Because of this ngnix throws 400 error.
http header: "AUTHORIZATION: Bearer token"
2023/08/16 12:...
0
votes
0
answers
35
views
Configure nginx caching with header cache_key
How can I configure nginx to cache the body of a response, with the cache_key being a header in the response. for example:
POST domain/user
returns body {"id": 1, "name":"user-...
0
votes
1
answer
56
views
Can't set nginx static files with openshift microservice
I have a project with microservices on openshift.
one of my services uses react and I am using nginx to serve the static files.
Now let's say my DNS is https://greg.com
and my microservice path is /...
0
votes
0
answers
38
views
set a variable and log it
I want to name a location and record this name in the access log.
I define a variable somewhere up in the config via a map and assign it an empty string as a value. Then, within locations I set ...
0
votes
0
answers
9
views
Timeout issue with Nginx
I am hosting and wordpress site on digital ocean with 16gb mem and 4 cores connected with https://moss.sh/ to manage the site.
The issue I am facing my site goes down very frequently and I got 502 and ...
0
votes
0
answers
196
views
NGINX - External Service Interaction via HTTP Header Injection
I have received the "External Service Interaction via HTTP Header Injection" vulnerability report from security team upon scanning the customer facing domain:
Nginx is configured as proxy/LB ...
0
votes
0
answers
20
views
Forwarding different subdomains to the same upstream, same ip
I have a simple question for someone who really knows nginx, I'm offering 10 matic crypto as a thank you.
I have a NextJS app running on ubuntu localhost:3020
I have to subdomains, staking & ...
1
vote
1
answer
92
views
How to make multiple locations open the same index.html file in nginx?
I am developing a website (html/css/js, no php involved). Due to requirements, I use a docker container with an nginx image inside.
I have two HTML files that are the same. One should open as root (e....
0
votes
1
answer
55
views
Not Found: /static/frontend/styles.css (Docker, Django, Nginx)
I am trying out docker for the first time to deploy in production environment I followed some you- tube tutorials but i was successful in containerizing my Django project. but when i run it nothing ...
0
votes
0
answers
37
views
Nginx - how to add a new location
I have a server running Ubuntu Server 22.04. It is meant to run RStudio server and to deploy shiny apps and simple static webpages. I use nginx as my web server. This is my /etc/nginx/sites-available:
...
0
votes
0
answers
71
views
Custom 403 error static HTML page showing origin IP address in HTML page content
I m using NGINX version 1.23.3 and I wanna introduce a custom 403 static error HTML page, which dynamically shows the client origin IP address in the HTML page content.
Since I use Kubernetes and ...