ERR_NAME_NOT_RESOLVED when trying to connect to api through proxy - nginx

I have a website, and lately I had to change the web address. When the user first enters "http://name-of_the.website.pl", he is greeted with login screen. This part is working perfectly. As soon as the user enters credentials and hits the login button, the website throws ERR_NAME_NOT_RESOLVED.
The login page is trying to connect to api (deployed in the same docker swarm) through nginx proxy (code below). After inspecting proxy logs I have found this:
2021-11-11 18:02:05 +0000 2021/11/11 18:02:05 [error] 15#15: *192 config.json could not be resolved (3: Host not found), client: 10.0.0.2, server: ~^proxy\.name-of_the\.website\.pl$, request: "GET /config.json HTTP/1.1
The whole thing used to work great before changing the host name.

So everything was fine with my proxy and the website. The reason it did not work was the fact that the website was trying to connect to local proxy while it was on the server somewhere else. All I had to do was add the address of the server hosting the proxy and the rest of the app to hosts file on my machine.

Related

Pydio cells-sync client can't connect

I installed pydio with cells v3 on my windows server behind nginx.
The service is up and reachable from both the outside the network at sub.domain.com and within my network using the servers local IP. From outside, SSL is working, from inside the self-issued SSL certificate is used and flaged as insecure.
The browser interface is working perfectly fine. However, I can't log in using the win-desktop client or andriod app. Entering https://sub.domain.com and clicking 'Username' opens the browser and I get a 520 'Web server is returning an unknown error.' Before the error, the pydio interface is rendered for a few milliseconds:
Connecting...
Application is not yet connected to agent. Please wait
while we are trying to connect...
followed immediately by
Disconnecting
Application is disconnected from agent. Please wait
while we are trying to reconnect...
However, the logs in the admin page don't show any errors.
Interestingly, when the 520 error is shown in the browser, the URL begins with domain.com, not sub.domain.com.
I have only mapped sub.domain.com to internal-server-IP:8080 in nginx.
Am I missing something here?

Nginx domain resolution 502 gateway

I have developed a website for a customer, it's currently sitting on a sub-domain on our server and is finished but i now need to carry out testing for eCommerce payments and that means the site needs to move from our sub-domain over to their live domain.
For this, i've created a cPanel account with that domain but because it's live elsewhere, the best way for me to complete the migration before any DNS records are changed on the 3rd party hosting is to be able to access the site on my machine, i edited my local host files (windows) for that reason
Before NGINX was installed on the CentOS server, modifying the local host file would work perfectly and i could access the site only on my machine to finish up the migration, then when finished i'll ask the 3rd party host to change NS to our us, meaning no downtime to their site and a nice migration.
At the moment, even though the host file is changed and a local cmd ping brings up our server, i get a 502 gateway error nginx in the browser, checking nginx error logs i believe it's because nginx server is trying to resolve the 3rd party real host IP address but my machine is set to resolve the server ip version.
Does that make sense? All other sites on the server are working fine through Apache + Nginx but i'm stuck with this problem.
I could simply ask the 3rd party hosting company to change the A record to point to our server but it would mean the client would face some downtime while i finished up the migration.
Any help is appreciated.
Purging nginx cache and reloading
Here is the error message regarding this specific domain in nginx
2019/09/25 10:58:19 [error] 25641#25641: *47 connect() failed (111: Connection refused) while connecting to upstream, client: IP.ADDRESS, server: localhost, request: "GET / HTTP/1.1", upstream: "http://IP.ADDRESS:8080/", host: "www.xxx.co.uk"
The IP address here in this error is the real one where the site is live at the moment.
I found that all i needed to do was edit the /etc/nginx/custom_rules and adding the domain and ip address under "when to specify a domain name". I can now access it locally.

IIS url rewrite reverse proxy to asp.net core web app on localhost

I have a IIS 8 on a server where some sites are hosted. I want to call my ASP.NET App which should not be hosted as a site in my IIS, but it should be reached over localhost:5001 on the IIS server.
To achieve that I created a site in my IIS which should port forward to my backend app. For that I used the url rewrite module -> Reverse Proxy. I entered in the Inbound Rules the address which should be navigated to, so I used for that localhost:5001 and left all the settings as default.
If I look at all the tutorials, everything should be working now, but I always get the following error:
HTTP Error 502.3 - Bad Gateway
The server returned an invalid or unrecognized response
Error Code: 0x80072f78
The certificate for the https site which should port through to localhost is valid, since the error code guides me to certificate errors.
Okay, it was a problem with the certificate of my backend app. If I call the proxy it works perfectly fine, it just throws the exception with the certificate error. So the backend app doesn´t have to run over https.

IIS - ip browsing ok, dns error

I'm setting up website. IIS hosting my site (ASP.NET) is located on server server1. when I connect to my website http://server1.com/site/ eveything work fine.
We decided to use DNS alias - supersite, which means, when I connect to my website using http://supersite.com/site/, this should be equal to first request.
Command line ping command shows the same server - this is for sure.
This doesn't happen. When I'm connecting with raw URL http://server1.com/site/, server responds correctly, when I connect using DNS alias http://supersite.com/site/, server returns:
The page cannot be displayed because an internal server error has occurred.
I tried configure more detailed information, I set up Error Pages -> 500 -> Detailed Error, I enabled Send errors to browser in ASP menu. Nothing helps.
I think, that server doesn't connect to my website when I'm using DNS alias and all my attempts enabling detailed errors means nothing.

AWS Opsworks, Spring mvc: Unable to open my application on browser

I have deployed my application using AWS Opsworks. I could see that my application has been deployed successfully, however I am not able to open it in a browser. I tried many many combinations of url, but no luck.
On my localhost, I access my application with this url:
http://localhost:8080/app/login.
In opsworks my app name is "bootshop" and it has been deployed successfully.
Now how do i access my login page ???
I tried below urls:
login page: http://xx.xx.xx.xx:8080/bootshop/app/login - 404 Requested resource not available
index.html page: http://xx.xx.xx.xx:8080/bootshop/app/ - 404 Requested resource not available
http://xx.xx.xx.xx:8080/bootshop/login - 404 Requested resource not available
http://xx.xx.xx.xx:8080/bootshop/ - Nothing is displayed on
http://xx.xx.xx.xx - Forbidden
For my EC2 instance, I have custom TCP rule set.. which allows traffic on port 8080 from anywhere.
Your help would be really appreciated.
Thank you
The 8080 address is the internal address that Apache web server uses to communicate with the Tomcat instance. The public address that you should use is 80. Just use the root path of your server to access the application, like this:
http://xx.xx.xx.xx
where xx.xx.xx.xx is your IP address. You can of course use the DNS name if you have any for that IP address.
Make sure that you allow HTTP traffic to port 80 in the security group for the EC2 instance where the application is running.

Resources