1,405 questions
0
votes
0
answers
103
views
NGINX auth_request does not work with return 204
I'm trying to create an NGINX endpoint that will validate the session using auth_request directive and return the auth-token in a header without a response body. location /whoami block in config below....
0
votes
0
answers
141
views
How to exclude http requests for static files from nginx rate limiting
I'm using below nginx block. I want to exclude all requests for js and CSS files from nginx rate limiting. With my below nginx directives, rate limiting is excluded to all files apart from /api route. ...
0
votes
0
answers
55
views
Upload Progress Not Working with Nginx and ExpressJS
I have a simple expressjs app set up behind the Nginx server to take requests to upload the files.
When uploading files without Nginx server, the upload progress is obtained through XMLHttpRequest ...
0
votes
0
answers
27
views
nginx proxy pass issue
map $arg_internal $redirect {
default 0;
"true" 1;
}
server {
#Swap the following two lines to get the redirect working again
server_name developer-nonprod.com;
listen ...
0
votes
0
answers
20
views
nginx route config to support react app and static/marketing html site on one URL
On a VM host which is at https://myhost.com/, I have a docker container running a (react) app which listens on :3000. Separately, I have a static/marketing html page at /var/www/html/index.html.
I am ...
0
votes
1
answer
50
views
Defining locations with and without trailing slash in modern nginx
INFO
I have below directories structure:
.
├── fruits
│ └── index.html
├── index.html
├── styles.css
and the content of my /etc/nginx/nginx.conf file is:
http {
include mime.types;
server {...
0
votes
0
answers
100
views
Nginx : Invalid condition "yes" in nginx.conf
I have an environment variable set as
vod_enable_encryption = yes
which I'm attempting to check using an If block in nginx.conf.
Nginx isn't able to resolve the condition and throwing the following ...
0
votes
0
answers
25
views
Handle HTTP Response For iframe - 405 on OPTIONS
I'm adding in an iframe onto a page and when it makes a CORS request to another static file on my server, it always responds with a 405 response. I've tried editing my sites-enabled\domain file to ...
0
votes
0
answers
71
views
How do I return a response from the destination server in case of an error in Nginx?
I need to always return in case of errors. 400, 401, 403, 404, 500... my html pages with errors if the response is from the destination server is text/html, otherwise I can return the server's ...
0
votes
0
answers
42
views
Nginx serves files at root (/) but not at subpaths (/admin, /user)
I have set up Nginx on my server to serve static files for a front-end application. The root URL (http://xxx.85.127.14/) correctly serves files, but when I try to access http://xxx.85.127.14/admin I ...
0
votes
2
answers
134
views
Block URLs with query strings in Nginx [closed]
I'm trying to use Nginx Location to block requests similar to this, which are causing load issues with WordPress (and the multilingual WPML plugin):
GET /foo/bar/?s=/?s=/?s=/?s=/?s=/?s=/?s=/?s=/?s=/?s=...
-1
votes
1
answer
73
views
Nginx DNS Resolver in docker depend on the conditions of the transformation
I want to understand why this happens. When I use proxy_pass without regular expressions, everything works great, the DNS is resolved, and so on.
location /images/ {
proxy_pass http://sfs-...
0
votes
0
answers
40
views
Returns 404 for only 1 route via nginx
this is my nginx.conf file, my react app is hosted on nginx and calling api endpoints, my api end points starts something like this
https://export.
https://report.
etc.
9 out of 10 endpoints are ...
0
votes
0
answers
79
views
In Safari, requests without a trailing slash are not redirected to those with a trailing slash
I am serving static content with Nginx, and I have a question about the behavior of requests without a trailing slash. While everything works fine in Chrome, Safari behaves differently.
When I access ...
0
votes
0
answers
52
views
Backend fails after adding SSL certificate. Nest/Nginx
My backend is not working after adding the SSL certificate. The backend worked with http before but after adding SSL certificate it stopped working. I thought the problem is with nginx configurations ...
-1
votes
1
answer
90
views
How do I force nginx basic authentication for files starting with a certain mask?
I want my nginx instance to switch to basic authentication when serving all files starting with /dev-*.* mask.
For example, if the /dev-phpinfo.php is requested, only a specific user may be able to ...
0
votes
1
answer
72
views
MIME type errors with NGINX maintenance config and angular?
I have a maintenance config I created with nginx which I simply swap for my prod one. It is meant to call an index.html which is based on an Angular SPA and route to the /maintenance page created ...
0
votes
0
answers
69
views
Nginx location block allow/deny
I've tried to find the answer in this forum, reading Nginx location priority and others, but can't get this to work. It is regarding location blocks in Nginx.
I want to generally deny access to 'data' ...
0
votes
0
answers
220
views
How to mask/hide URL with Nginx Proxy Manager?
First of all, thanks in advance for taking some of your time to read this.
I would like to get some help.
I'm using Nginx Proxy Manager Proxy Hosts option to convert this: http://10.0.0.10:3001/status/...
0
votes
1
answer
308
views
The POST request body as part of the cache key in NGINX caching is not working as expected
I am attempting to use NGINX as a reverse proxy in front of a GraphQL server and leverage NGINX caching. In my configuration, I intend to cache the response of POST API requests, considering both the ...
0
votes
1
answer
126
views
Wagtail(django) and Nginx Static files not being served
I am deploying a wagtail site with nginx on rocky linux however, I cannot get the static files to be served by nginx.
My nginx site config is as follows:
server {
listen 80;
...
1
vote
0
answers
137
views
Nginx proxy changing POST requests to GET on upstream server
I'm using Nginx as a reverse proxy with SSL to route requests to a backend server. However, when I send POST requests, they’re received as GET requests on the backend.
server {
listen 80;
...
0
votes
1
answer
247
views
Problem setting nginx variable from inside lua block - Value doesn´t change on nginx/location variable
I'm setting nginx as a load balance for web applications and in one of them we have to filter the last character of a document field to decide where to send that request. So I decided to set a flag &...
0
votes
1
answer
162
views
Nginx Alias To Serve Static Files With A Variable In The Path
I have an nginx service that makes heavy use of maps to produce different redirects based on each user. I have used these variable fine in proxy_pass calls.
I now want to serve static files from a ...
-1
votes
1
answer
45
views
Are location specific logfiles treated different?
I am using nginx to access various services on a machine. Therefor I added specific logfiles for each proxied service:
location /errorcodes/ {
include /etc/nginx/sinatra_params;
proxy_pass http://...
-1
votes
1
answer
363
views
Dockerized NGINX with Reverse proxy doesn't listen on the default port
I have deployed my django backend api on Amazon Ec2 using docker successfully.
My first step is when I attempted to put in a dockerized Nginx to act as a reverse proxy. I then eventually intend to use ...
1
vote
1
answer
574
views
NGINX: How to Disable Client SSL Certificate for Specific URIs While Enforcing It for Others?
We are experiencing challenges with our NGINX configuration and could use some help. We have hosted a web application using NGINX, and our web application is protected by a client SSL certificate—...
0
votes
1
answer
57
views
Nginx catch-all routes, except root route
So, I have a URL Shortener website, and I want ONLY the root path to be served via static files and other routes to be redirected to their destination via API.
I found the solution with location = /, ...
0
votes
0
answers
69
views
How to handle X-Forwarded-Host & X-Forwarded-Proto to stop redirect the service to invalid host
In my scenario, when bot pass the mod header X-Forwarded-Host : anydomain.com and X-Forwarded-Proto : http then the page is redirect to anydomain.com instead to throwing a error or blocking the ...
1
vote
1
answer
176
views
I need help understanding trailing slash behaviour in Nginx
I'm setting up nginx as a reverse proxy for squaremap (a world map viewer for Minecraft servers) and encountering unexpected behavior with trailing slashes. I've followed the squaremap documentation ...
1
vote
1
answer
78
views
Nginx location specific timeout
I am trying to rewrite proxy_read_timeout for a specific route that sends requests to Replicate that has longer response times.
If the AI model is cold, it takes more than 1 minute to respond and ...
-1
votes
1
answer
70
views
The issue of try_files configure in nginx.conf
my nginx version is 1.16.1. this is my try_filse configure:
location / {
root /home/nginx/html/dist/;
try_files $uri $uri/ /index.html;
}
location = /index.html {
root /home/nginx/...
0
votes
1
answer
72
views
NGINX wordpress admin - allow not working but deny all is
so I am having issues whitelisting a IP range to allow access to the wp-admin endpoint under location.
I have something similar to the below in the nginx.conf (The IP listed is an example). When I ...
1
vote
1
answer
57
views
Accessing just a specific folder should redirect [closed]
I would like to be able to redirect users who visit a folder/directory in my nginx website I do not intend on people actually viewing. Example: if a client accessed a directory like https://example....
0
votes
1
answer
133
views
upstream name comes to url in browser - nginx configuration
I'm new to ngnix. I'm trying to use nginx cache for static files in server.
nginx configuration for that specific server in http block:
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=...
0
votes
1
answer
94
views
Nginx 404 not found when refreshing, also with try_files $uri $uri/ /index.html =404;
I cannot figure out how to reslove the 404 error while refreshing.
here is related part of my config:
server {
server_name example.com;
location / {
proxy_pass http://192.168.x.y:...
0
votes
1
answer
80
views
Block certain requests in Nginx without also triggering a redirect to the www subdomain
From time to time my website is getting hammered by requests to all sort of php files (we don't host any php files) and all sort of wp-content and wp-includes things, which I want to deny at the Nginx ...
2
votes
0
answers
94
views
NGINX proxy to URI based on parameter value
I'd like to build a proxy_pass in NGINX that proxies a request to a downstream server. The special case is that the target URI consists of some domain and a path and parameters that need to be built ...
0
votes
0
answers
29
views
Problem in vue nginx.conf, requests are not working
there is such a code
const urls = {
users: "/users/api/v1/user",
roles: "/users/api/v1/role",
};
and
location /users/ {
proxy_pass https://$USER_URL/;
proxy_redirect ...
1
vote
0
answers
160
views
SimpleSamlPHP Admin Page 404 Not Found Nginx
I am trying to hit the admin page of simplesamlphp on an Azure app service running php 8.2 on Linux. Mediawiki 1.39.7 is installed in wwwroot/wiki and simplesamlphp 2.2.1 in wwwroot/wiki/var. I keep ...
0
votes
0
answers
13
views
Replace a hyphen with a slash in an nginx rewrite
My HTML:
<a href='accueil/accueil.html'>
My nginx rule:
location ~ \.html$ {
rewrite (?<module>([a-zA-Z]+))/(?<menu>([a-zA-Z]+))\.html$ /controleur?module=$module&...
2
votes
0
answers
63
views
Nginx returning 502 timeout within milliseconds
Our production implementation looks like this
Internet-Facing-ALB ---> Nginx-Cluster-On-Ec2 ----> Internal-ALB --> Application Ec2
We are sometime getting 502 timeout error within a ...
0
votes
0
answers
257
views
Why is this NGINX proxy_pass scheme not working
I have an nginx server running and am doing a reverse proxy to other web systems. below is my configuration
server {
# HTTP configuration
listen 80;
listen [::]:80;
listen 443 ssl;...
0
votes
0
answers
50
views
NGINX Rewrite from a static URL to a dynamic URL
I am trying to rewrite a semi static URL path to a dynamic path without much luck. In full transparency, I am pretty new to NGINX and regex, so please bare with me.
I am redirecting from this path: /...
0
votes
0
answers
43
views
NGINX reverse proxy on containerized web-app
I am trying to reverse proxy several services on a remote server that has only port 443 opened. When I route the request to services without UI, it works. But if I try to bound a route with UI it ...
0
votes
0
answers
44
views
prevent nginx from dropping first slash on proxy pass uri
We are using nginx for proxying requests received at some.url.com to an application (eXist-db) on an internal server. For this, we must take the path after the request domain and pass it as uri based ...
1
vote
1
answer
604
views
Nginx root location with proxy_pass and subpath with try_files
I have an Nginx server that must combine one React app and another Nginx with a PHP configuration as follows:
On /client path serves a React app with the files hosted on the current Nginx instance.
...
0
votes
0
answers
213
views
nginx redirects for file downloads
I have a location block in nginx for my appservers that handles requests from clients who want to download binary objects ending in .bin that are stored on a CDN server.
location ~ ^/file/blob/dl/(.+\...
0
votes
1
answer
628
views
Nginx configuration with Frontend and Backed applications in the same server, failes with Access to XMLHttpRequest has been blocked by CORS policy
I deployed 2 applications in a Ubuntu 22.04.4 LTS server,
a backend FastAPI service, and a frontend Reactjs application.
The backend runs on http://localhost:8000, and it serves APIs at /api/v1
The ...
0
votes
0
answers
616
views
nginx read timeout for a specific path
I'm using Cloud66 which has a long nginx config.
This config is currently proxy passing to Puma, which is a Rails server (my app).
All I'm wanting to do is specify a 10m proxy_read_timeout ONLY to my /...