Questions tagged [nginx-config]
2020 questions
3
votes
1 answer
Conditionally map values in nginx config
I have a scenario where I want to proxy_pass requests to one of several upstream destinations based on a value which can appear in a header or as a query parameter.
Right now, I've got the header-based mapping mostly figured out:
map…

a p
- 3,098
- 2
- 24
- 46
3
votes
1 answer
Is there any way to make your nginx proxy not forward HTTP -> HTTPS for a specific URL only?
I have auto SSL enabled for a VHOST, but I need to disabled that for a specific URL that needs to accept only non SSL requests.
This, put into vhosts, is working fine if the specific old URL was HTTPS, but it is HTTP. I cannot use…

Matt Barnicle
- 33
- 3
3
votes
2 answers
nginx conf file: Detect if browser language is "de", then redirect to page .... else redirect to other page
I want to create a link in a banner to redirect to one of two pages. The link points to subdomain.example.com/email. If the browser language is "de" then go to www.example.de/banner else go to www.example.com/banner. My nginx conf language skills…

Dan
- 103
- 1
- 7
3
votes
3 answers
When mounting /etc/nginx/ container doesnt run
I want to mount the /etc/nginx folder to a custom folder on my host. However, whenever I try this the container doesn't run at all. Mounting anything else doesnt seem to be problem, though the folder I want it to mount to is always empty.
I tried…

Raphael
- 65
- 1
- 7
3
votes
1 answer
$_POST is empty on nginx
My problem seems similar with $_POST is empty. Nginx OSx , $_POST is empty in nginx and $_GET filled but $_REQUEST is empty, however I cannot find a solution to work for me there.
Long story short, I cannot get my POST request through to a file…

Angelin Calu
- 1,905
- 8
- 24
- 44
3
votes
1 answer
Send all requests to index.html except certain extensions
I'm using nginx to serve my react app and it serves me well in redirecting everything except static files to index.html with the following:
location / {
try_files $uri /index.html =404;
}
I was content with this for some time but noticed that…

vinczemarton
- 7,756
- 6
- 54
- 86
3
votes
0 answers
Nginx SSL Proxy to upstream server using SSL
I am using nginx as a proxy to kestrel web server both nginx and kestrel are configured for mutual TLS whereby a client can only communicate with the server unless a certificate is sent with the request. I would like to be able to forward the ssl…

Emmanuel Ashaye
- 31
- 1
3
votes
1 answer
(Http-01): urn: ietf: params: acme: error: unauthorized error when I execute "$ sudo certbot renew --dry-run" command
environment ・Nginx ・ CentOS 7 ・ Certbot 0.31.0
$ sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Processing /etc/letsencrypt/renewal/hoge.example.com.conf
Cert not due for renewal, but simulating renewal…

re1
- 435
- 1
- 7
- 17
3
votes
2 answers
Rewrite in Subpath 404 urls with Nginx
Currently I have a main redirect to the home of my webserver. However I would like to treat the subpaths with redirect after a 404 was not for the home and yes for the subpath, that with multiple subpaths. That not to repeat the rules, I must deal…

Vinicius Peres
- 81
- 9
3
votes
1 answer
NGinx and multiple docker containers but one subdomain
My Goal
I want to use a single NGinx docker container as a proxy.
I want it to respond to traffic on my domain: "sub.domain.com" and listen on port 80 and 443.
When traffic comes in on /admin I want it to direct all traffic to one docker container…

Captainlonate
- 4,878
- 4
- 25
- 35
3
votes
2 answers
Serving static website in nginx, wrong path for static files
I'm trying to use nginx to serve a static website that was given to me. Its folder structure is like this:
static_website/
index.html
www.example.com/
resources.example.com/
uploads.example.com/
The index.html file in the root is…

Carlo
- 4,016
- 7
- 44
- 65
3
votes
0 answers
NGINX Not Serving "Fast" Stale Content with proxy_cache_background_update
We are running NGINX in front of our backend server.
We are attempting to enable the proxy_cache_background_update feature to allow NGINX to async updates to the cache and serve STALE content while it does this.
However, we are noticing that it…

Ted Wilmont
- 463
- 2
- 9
- 20
3
votes
2 answers
How to connect back-end with front-end using ngnix in Kubernetes
I have a back-end service deployed in Kubernetes (at http://purser.default.svc.cluster.local:3030) and a front-end angular 6 application with nginx.conf as
upstream purser {
server purser.default.svc.cluster.local:3030;
}
server {
listen…

Kaladin
- 321
- 2
- 11
3
votes
1 answer
Can't rename specific .php file with .html names on nginx
I had an apache server where I was running my php application. It had these htaccess rules:
php_flag log_errors Off
RewriteEngine on
RewriteRule thankyou.html /thankyou.php
RewriteRule ^([^/]*)\.html$ /user.php?username=$1 [L]
RewriteCond %{HTTPS}…

Giuseppe87
- 406
- 4
- 14
3
votes
1 answer
unknown directive "proxy_cache_revalidate on" with Nginx conf
I am trying to implement nginx-cache using nginx.conf file.
I have referred the code from here
Regards to that, I am using proxy_cache_ upstream.
Below is the error that I am facing if I use proxy_cache_ directive. (I have commented other…

Anand Deshmukh
- 1,086
- 2
- 17
- 35