Query on nginx. conf file regarding redirection.

Kaushal Shriyan kaushalshriyan at gmail.com
Fri Oct 30 17:15:14 UTC 2020


On Fri, Oct 30, 2020 at 4:35 AM Francis Daly <francis at daoine.org> wrote:

> On Thu, Oct 29, 2020 at 11:42:11PM +0530, Kaushal Shriyan wrote:
>
> Hi there,
>
> > When I hit this URL http://219.11.134.114/test/_plugin/kibana/app/kibana
> on
> > the browser it does not get redirected to
> > https://vpc-lab-test-search-7hyay88a9kjuisl.eu-north-1.es.amazonaws.com/
> ;
>
> What does the nginx access log or error log say happened to that request?
>
> Also: what IP address does
> vpc-lab-test-search-7hyay88a9kjuisl.eu-north-1.es.amazonaws.com have
> right now; and what IP address did it have when nginx was started?
>
>
> Your test request goes to port 80 on a specific IP address; your nginx
> is listening on port 81 on a non-specified IP address -- if the nginx
> logs do not show that this nginx got that request, then that's a thing
> to fix before the nginx config.
>
> And your proxy_pass is to a hostname that will be resolved once,
> at startup; if the remote address changes, your nginx config will not
> notice the change.
>
> > Similarly, when I hit this URL
> > http://219.11.134.114/prod/_plugin/kibana/app/kibana on the browser it
> does
> > not get redirected to
> > https://vpc-lab-prod-search-9aay182kkjoisl.eu-north-1.es.amazonaws.com/
>
> Same questions; same reasons (except this nginx does listen on port 80).
>
> Cheers,
>
>
>


Hi Francis,

I am seeing this below message when I hit
http://219.11.134.114/test/_plugin/kibana/app/kibana

==> /var/log/nginx/error.log <==
2020/10/30 17:10:57 [error] 9616#0: *20 open()
"/usr/share/nginx/html/test/_plugin/kibana/app/kibana" failed (2: No such
file or directory), client: 14.98.153.6, server: , request: "GET
/test/_plugin/kibana/app/kibana HTTP/1.1", host: "219.11.134.114"

==> /var/log/nginx/access.log <==
14.98.153.6 - - [30/Oct/2020:17:10:57 +0000] "GET
/test/_plugin/kibana/app/kibana HTTP/1.1" 404 3650 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/86.0.4240.111 Safari/537.36" "-"


 # TEST
    server {
     listen 80;
     location /test {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        #fastcgi_read_timeout 240;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        send_timeout 600;
        proxy_pass
https://vpc-lab-test-search-7hyay88a9kjuisl.eu-north-1.es.amazonaws.com/;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

Also, I am not sure why it is getting referenced to /usr/share/nginx/html/?
Is there a way to change the default document root? Please suggest further.

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20201030/8c373194/attachment.htm>


More information about the nginx mailing list