Kibana/nginx could not connect to elasticsearch - nginx

I have Elasticsearch and Kibana with nginx running on a EC2 instance but Kibana/nginx is not able to connect to Elasticsearch and I'm getting "Error Could not contact Elasticsearch at xxxxxxxx. Please ensure that Elasticsearch is reachable from your system".
When I see the nginx error logs, I get -
[error] 13067#0: *1 access forbidden by rule, client: xxxxx, server: 127.0.0.1, request: "GET /index.html HTTP/1.1", host: "xxxxx"
[error] 13283#0: *14 no user/password was provided for basic authentication, client: xxxxx, server: xxxxxx, request: "GET //cgi-bin/php5 HTTP/1.1", host: "xxxxx"
My conf file is - http://pastebin.com/JuxifP2n

Related

How to deploy multiple .net core projects in a single elastic beanstalk server?

I have a single solution with 2 projects - https://github.com/vickyrathee/dotnet-test-app
My Website: dotnet-test-website (domain.com)
My API: dotnet-test-api (api.domain.com)
How can I configure my projects to be deployed on single Ubuntu/Amazon linux server?
I already tried using the Urls option on appsettings.json to set port 5001 for API project and 5002 for website project as mentioned here
https://github.com/vickyrathee/dotnet-test-app/blob/master/dotnet-test-app/appsettings.json
{
"Urls" : "http://localhost:5001"
}
But as per the EB logs, it seems to trying port 5000 instead what I defined in appsettings.json
----------------------------------------
/var/log/nginx/error.log
----------------------------------------
2021/02/14 09:11:24 [error] 3583#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"
2021/02/14 09:11:39 [error] 3583#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"
2021/02/14 09:11:54 [error] 3583#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.146, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "172.31.26.188"
Additionally, how to publish it correctly in separate folders, So that there are no conflict between them. EB allow single zip file upload with appsettings.json on root, while I have two with some other files as well in common and can't just put them on single directory to zip. Any help will be appreciated.

502 Bad Gateway Issue - Using Nginx and Jenkins

I'm facing a problem with one server mine. I have a configuration of a Jenkins application running under Nginx in a Ubuntu OS.
But after updating Jenkins to a new version, when I try to reach my Jenkins web application, I get this error:
"502 Bad Gateway - nginx/1.14.0 (Ubuntu)"
Apparently all my configuration are okay.
How can I solve it?
Nginx error log:
2019/04/24 16:20:02 [error] 11424#11424: *2 connect() failed (111: Connection refused) while connecting to upstream, client: yyy.yy.yyy.yy, server: xx.xx.xxx.xxx, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "xx.xx.xxx.xxx", referrer: "http://xx.xx.xxx.xxx/"

What nginx server config exactly should be for Nuxt.js Universal project?

I've got big troubles with deploy my nuxt.js project on Ubuntu with Nginx;
Ubuntu 18.04 + nginx
Nuxt.js 2.3.2 (universal mode)
So maybe somebody can help me to resolve my problem)
I will to describe all things around this problem below:
My nuxt.conf build part
My nginx config
Then I run this command in ssh
sudo npm run build
sudo pm2 start npm --name "nuxt" -- start
Now server is listening localhost:3000, as I wrote in package.json
After all this I've got 500 error in console, when I open my site.
Server error
nginx error.log
2018/11/26 04:48:42 [error] 15032#15032: *5773 upstream prematurely closed connection while reading response header from upstream, client: 173.267.244.9, server: example.com, request: "GET /seller HTTP/1.1", upstream: "http://127.0.0.1:3000/seller", host: "example.com"
2018/11/26 04:48:42 [error] 15032#15032: *5773 connect() failed (111: Connection refused) while connecting to upstream, client: 173.267.244.9, server: example.com, request: "GET /seller HTTP/1.1", upstream: "http://[::1]:3000/seller", host: "example.com"
2018/11/26 04:48:43 [error] 15032#15032: *5773 no live upstreams while connecting to upstream, client: 173.267.244.9, server: example.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://localhost/favicon.ico", host: "example.com", referrer: "http://example.com/seller"
So now I have no idea whats wrong with that. Help me please.
It seems that Nginx tries to connect on the IPv6 loopback [::1], and nodejs is probably just listening on IPv4.
Try setting 127.0.0.1 instead of localhost

nginx + nodejs proxy error

2017/10/10 10:22:26 [crit] 1289#0: *1 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 81.x.x.x, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "mydomain.com"
why does this not work?
I can access the 127.0.0.1:8080 via curl but nginx just displays a 502 error
Fixed this by disabling SELinux which should not have been enabled in the first place.

nginx error log - request from unknown hosts

I am getting request from unknown hosts in nginx error.log trying to request files or requests which don't exist in the system.
Receiving below list of errors in error log,
directory index is forbidden, client: 61.157.96.126, request: "GET http://www.haosou.com/?rands=_688651072032161501826712 HTTP/1.1", host: "www.haosou.com"
[error] 10006#0: *67753 open() /favicon.ico" failed (2: No such file or directory), client: 95.25.186.223, request: "POST http://t3.proxy-checks.com/favicon.ico HTTP/1.1", host: "t3.proxy-checks.com"
[error] 10006#0: *66849 directory index of "--" is forbidden, client: 120.132.95.89, request: "GET http://www.qunar.com/ HTTP/1.1", host: "www.qunar.com"
What could be the issue here? Do I need to make any configuration changes on my server to stop such requests? or Is it ok to receive such requests on server?

Resources