Questions tagged [nginx-config]

2020 questions
2
votes
1 answer

Config ElasticSearch Magento 2.4 - No alive nodes found in your cluster

When trying to search for a product in magento 2.4 returns the following error Exception #0 (Elasticsearch\Common\Exceptions\NoNodesAvailableException): No alive nodes found in your cluster Below configuration: PHP 7.4.1 Nginx 1.14 MySql…
2
votes
2 answers

Nginx redirect works on the browser but when using curl, it only outputs 301 moved permanently

I have a default.conf file that shows: server { listen 80; server_name localhost; rewrite ^/(.*)$ https://objectstorage.ca-city.oraclecloud.com/n/randomhash/b/bucketname/o/$1 permanent; error_page 500 502 503 504 …
chocokoala
  • 191
  • 4
  • 15
2
votes
2 answers

how to configure nginx with angular ssr and pm2

I have a problem that I really no longer know how to configure nginx with pm2 so that when I do f5 it redirects and works for me when they share a link from the web. Currently in Angular Universa I did npm run build: ssr. I create a dist folder and…
Franco Androetto
  • 447
  • 1
  • 5
  • 17
2
votes
1 answer

What's the difference of $http_host:$proxy_port and $host:$server_port in Nginx

The company that I work for, uses Nginx for Reverse Proxy and Load Balancer, so I just add an another block to nginx.conf file as shown below for the new service, when requesting Nginx server with curl http://10.11.12.15:8080/api Nginx returns 400…
fuat
  • 1,484
  • 2
  • 19
  • 25
2
votes
0 answers

Logging POST body (request and response) with ingress-nginx

It seems that out of the box ngx_http_core_module should log request_body if it's part of the log_format. However, Im not seeing this working for anything that includes auth_request in location block. Im not entirely sure what causes it. It appears…
nixgadget
  • 6,983
  • 16
  • 70
  • 103
2
votes
0 answers

Nginx Subdomain Server Blocks keep redirecting to main domain in Centos 7

I have a WordPress site and trying to set up subdomains using Nginx and Let's Encrypt SSL to have prod and test environments. For example: prod site --> abc.com www.abc.com dev site --> dev.abc.com I have set up Nginx using this guide…
R. Patel
  • 49
  • 6
2
votes
3 answers

502 Bad Gateway for Proxy Pass to HTTPS API server sitting behind Cloudflare Proxy

My current configuration is as shown below. I have frontend delivered from EC2 instance on VM1. The HTTPS API server is on VM2 proxied by Cloudfare. If I call the API on VM2 directly from the web browser everything works fine. But if I use…
2
votes
1 answer

NGINX 301 redirect using query argument value

I want to redirect example.com/?lang=en to example.com/en/. I am using Python Django and my server running Plesk / Nginx. I try to redirect on my webpage like this. But it's don't work; rewrite ^/?lang=en$ /en/ redirect; But if i remove question…
Aytek
  • 224
  • 4
  • 16
2
votes
3 answers

How does Nginx proxy_pass pass a route parameter

I'm trying to make an api call to an internal docker container, but for every request url I have to make a proxy_pass in the Nginx config. I've read articles that the slashes at the end should work to pass all after de certain url to the…
2
votes
1 answer

How to config Nginx serves desktop version and mobile version from two different folders

I have only one subdomain name available, e.g. https://sport.abc.com, I would like to serve desktop version from a folder called /wwwroot/sport.abc.com/dist/sport/desktop/ , however when detecting it's a mobile client, serve from a different folder…
jfordec H
  • 85
  • 1
  • 1
  • 6
2
votes
1 answer

How to override WWW-Authenticate on 401

I have a service that returns: WWW-Authenticate: Negotiate, Basic realm="TM1" Since this doesn't work with libcurl, I'm trying to use nginx to modify those headers like so: WWW-Authenticate: Negotiate WWW-Authenticate: Basic realm="TM1" My failed…
Michel Jung
  • 2,966
  • 6
  • 31
  • 51
2
votes
1 answer

How to test a server with a request without the “Host” header field

I have a server that is using Nginx's 444 to drop connections to undefined hosts: server { listen 80; server_name ""; return 444; } But I can't figure out how to test if it's working. Here are a few things I've tried,…
43Tesseracts
  • 4,617
  • 8
  • 48
  • 94
2
votes
1 answer

Nginx redirect image to page

On a Wordpress site running on Nginx, I am trying to redirect a single image to a page. /image/path/image.jpg => /page/to/redirect/to A couple of things I have tried within nginx server block (after each config change, restarted the…
Kodie
  • 103
  • 3
  • 9
2
votes
1 answer

How to configure nginx to use same port with same server name for 2 sites

I have 2 sites in one debian machine. Currently one is running on port 443/80 and another one is running on port 8090. My requirement is to run both sites on 443 and if I enter site.com/1 - I should be redirected to site 1 and if I enter site.com/2…
karikevinod
  • 633
  • 7
  • 16
2
votes
0 answers

Direct URL access results in 404 page not found on Nginx Server

I have deployed my node.js application on nginx server and it is up and running. I am able to access the application using the domain name that i bought. For example [www.myshopping.com] this is dummy name. When i am navigating to other URL through…
rak_6040
  • 65
  • 1
  • 1
  • 6