I'm running a nginx in a EC2 instance.
When trying to connect it with public dns, I get "connection timed out" error.
I run curl 127.0.0.1, it print nginx home page, so the nginx configure is fine.
I thins there is something wrong with my EC2 instance's security policy,but I have already set it to allow all the traffic in and out.
Thank u,guys.
It's because the iptable block the 80 port.
Flush iptables,it works.
Related
I have a react app(port 8080) and a backend node app(port 3001) running on an aws ec2 instance, I have nginx routing port 80 from the load balancer to the port 8080 on local host in nginx, but, my front end cannot connect to the backend with axios(localhost:3001).
I have an instance of node for the front end and back end in the folders client and server respectively.
I've tried connecting with http and https, adding a direct 3001 listener all the way up to the domain/balancer and replacing all the paths to the domain(didn't work and also insecure if it did), I also tried without nginx.
I have an Xamp server running on MacOs 10.14.6.
I activated port forwarding on it like that :
localhost:8080 -> 80 (Over SSH)
localhost:8443 -> 443 (Over SSH)
I can navigate to my website on localhost:8443 with no issue.
I have another server running Symfony 5.4 available at localhost:8000. I can navigate to this website with no issue too.
But from the 'Xamp hosted' website, I'm not able to make a request to the 'Symfony hosted' server. I have a "Connection Refused error".
I tried to request both 127.0.0.1:8000 and localhost:8000 : same behavior.
I tried to set the Symfony server to listen to a different port too : same behavior.
It only works when I make a request to the real local ip address (like 192.168.1.34:8000). The problem is that this IP is not stable so I'd like to make the localhost work properly.
What could be the cause of this error ?
What can I do to use localhost hostname for my requests ?
you can disable the task manager section for applications running on the same port which may when you want to request a connection on the server you will use it will get a similar rejection. I think it's more or less like that
I'm trying for the first time to connect my local server (Synology) through NGINX and Cloudflare so I can access it through my own domain name. I have the proxy host all set up pointing to my local IP address with the port and I have an SSL encryption using Let's Encrypt. The site gives me either a timed out error or unreachable, however one time somehow the site took my to ASUS aicloud which is through my ASUS ac68u router but I was not even pointing NGINX to that.
using cloudflare diagnostic center site it syas the request failed because the web server did not respond.
I'm not sure whether my router is blocking Cloudflare or if there is any other issue going on, would appreciate any help with the matter!
I see some strange logs in my kong container, which internally uses nginx:
2019/08/07 15:54:18 [info] 32#0: *96775 client closed connection while SSL handshaking, client: 10.244.0.1, server: 0.0.0.0:8443
This happens every 5 secs, like some sort of diagnostic is on.
In my kubernetes descriptor I set no ready or liveliness probe, so I can't understand why there are those calls and how can I prevent them from appearing as they only dirt my logs...
edit:
It seems it's the LoadBalancer service: I tried deleting it and I get no logs anymore...how to get rid of those logs though?
This has been already discussed on Kong forum in Stopping logs generated by the AWS ELB health check thread.
The same behaviour with lb heathcheck every few seconds.
Make Kong listen on plain HTTP port, open that port up only to the
subnet in which ELB is running (public most probably), and then don’t
open up port 80 on the ELB. So ELB will be able to Talk on port 80 for
health-check but there won’t be a HTTP port available to external
world.
Use L4 proxying (stream_listen) in kong, open up the port and
then make ELB healthcheck that port.
Both of solutions are reasonable.
Just simply check what is connecting to your nginx:
kubectl get po,svc --all-namespaces -owide | grep 10.244.0.1
after that, you should know what is happening inside your cluster, maybe a misconfigured pod or some clients.
I also encountered this error when watching the log of Nginx.
I use the Azure cloud, I found the ip in the log is the location of my Azure server
I resolved that by changing the Protocol option from [TCP] to [HTTPS] in Heath probes menu on Azure portal
I am trying to get GitLab setup with my current installation of Nginx but I keep getting an Error 502. I have included my configuration files, and not sure what I am doing wrong. But I followed the "Using a non-bundled web-server" steps on https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md
/etc/nginx/conf.d/gitlab-omnibus-nginx.conf
http://pastebin.com/bQ8eCiNh
/etc/gitlab/gitlab.rb
http://pastebin.com/Lw5tjwXy
HTTP 502 means "The server was acting as a gateway or proxy and received an invalid response from the upstream server." So there are two possibilities here.
Your Gitlab server is not actually working or is returning an invalid response. After starting the Gitlab server, use sudo netstat -plnt and make sure it is running on a port and note the port. Then connect directly to this port in your browser (or from the CLI on the server if necessary) and confirm that Gitlab is working fine without a proxy in front of it. If Gitlab is running on a socket and not a port, there are also tools to test HTTP servers through socket connections that you can use.
Nginx is not configured correctly to connect to Gitlab. In this case, check your Nginx error log to see if there is any more detail besides the "502" error.