I am getting a 503 error when trying to curl nginx from Jump Server & from LB Server. Does anyone know why this may be occurring?
Are we supposed to do any extra configuration with nginx to get this error to go away or is that the expected behavior for this task. When I run telnet stapp01 8091 it says that it is connected.
Also, being that this is Firewalld, aren’t we supposed to be using the WAN interface? I’m asking because I saw a few references in this forum to iptables being used with eth0 as an interface instead.
When I run curl stapp01:<nginx-port> from Jump Server & from LB Server I get the 403 error shown in the screenshot above.
When I run telnet stapp01 <nginx port>, however, it says that it’s connected.
I’ve tried getting this to work with eth0, without eth0, with WAN, and without any attached network interface, which then requires the use of iptables -F in order to avoid yet another error:No route to host`.
I guess configuration error. NGINX could not deliver the content that you have configured in nginx.conf.
it could be the file name or the path… or the permission to the content that you would like to publish…
If you can provide the config code, some KodeKloud senior engineers could easily diagnosis the cause of 403.
Thanks for responding. I FINALLY figured it out. You were right: I had to check the nginx.conf, something that I had checked before, but I had missed a couple of things/nuances.
When I went back to the NGINX Reverse Proxy proxy task (I completed that task over a week ago) and checked my notes, it all became a bit more clear.
It seemed so difficult, but now that I know…I know. Sometimes I have to do something a few times in order for things to stick. That’s how we learn I guess.
Is there a certain part of this task that you are stuck on?
To get rid of the 403 forbidden error when trying to curl nginx from the Jump host and from the LB server, I had to check/set the configuration(s) in the /etc/nginx/nginx.conf config file on each app server like so:
Then I had to run systemctl restart nginx to persist the changes.
Let me know if this helps:-)
PS.
The /etc/httpd/conf/httpd.conf configuration was already listening on the Apache port, so there were no issues there, but you might want to check it to make sure that it is listening in your environment…just to be sure.
Have you configured/added the iptables rule for the Apache port?
Also, make sure that you have added ServerName with the ip + port (127.0.0.1::<apache-port>) in the Apache conf file (etc/httpd/conf/httpd.conf).
You also need to add Listen <serverip-of-app-server-with-failing-connection>:<apache-port> via the Apache conf file on the app server that is failing to connect.
If you have these three things in place, the no route to host error should go away.