Welcome! Log In Create A New Profile

Advanced

Configuration issue with nginx

Posted by gctwnl 
Configuration issue with nginx
November 10, 2018 02:51PM
I'm not very experienced with nginx. I'm having trouble with using ngxinx as a proxy in front of minio. I've been adding a minio service (4 were already running fine) but now nginx has stopped working for me, so I must have messed something up.I'm running ngxinx and minio on macOS High Sierra, installed via brew.

When connecting from the new laptop, nginx reports:
2018/11/10 18:15:23 [error] 51450#0: *25 open() "/usr/local/Cellar/nginx/1.13.10/html/renskedocumentsanddesktop" failed (2: No such file or directory), client: 192.168.2.91, server: dumbledore.rna.nl, request: "GET /renskedocumentsanddesktop?max-keys=1000 HTTP/1.1", host: "dumbledore.rna.nl:9000"

So, while from another laptop, nginx passes the request apparently on to minio without problems (no log entry by nginx, but it works), from the other laptop it wants to load something highly appropriate, namely "renskedocumentsanddesktop" from somewhere in the nginx install tree.

Somehow, nginx tries to serve the file itself instead of acting like a proxy and passing it on.

nginx servers include is a file that looks like this:

server {
listen 9000 ssl;
server_name myhost.mydomain.tld;
ssl_certificate minio_certificate_chained.crt;
ssl_certificate_key minio_certificate.key;
ssl_protocols TLSv1.2;
proxy_buffering off;
client_max_body_size 1000m;
location / {
proxy_set_header Host $http_host;
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=***") {
proxy_pass http://127.0.0.1:9001;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=***") {
proxy_pass http://127.0.0.1:9002;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=***") {
proxy_pass http://127.0.0.1:9003;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=***") {
proxy_pass http://127.0.0.1:9004;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=***") {
proxy_pass http://127.0.0.1:9005;
}
}
}

And that works for addressing the minio on port 9003 but not the one on 9005 which produces the error. I'm completely baffled because as far as I can see for both services the nginx situation is technically the same



Edited 1 time(s). Last edit at 11/10/2018 02:51PM by gctwnl.
Re: Configuration issue with nginx
November 10, 2018 03:41PM
OK, as always, the answer was: a config error. The client wasn't using the exact right Credential and this means it fell through all the authorization statements. What I need is a default fall through that results in something and doesn't pass it on to the nginx install tree.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready