How to do a GET to IP address of site with Postman - get

I have a website hosted on a Windows Server that runs in IIS. I'm trying to do a GET request with Postman using the IP address of the server rather than the site URL.
Why does something this work: http://testsite.com/Callback?parameter=test
But this doesn't: http://{site IP address}/Callback?parameter=test

Try setting a Host: testsite.com header. The site might require that to work.
(if you can hit the URL in a web browser using the IP, then this isn't relevant)

Can you please check this setting in postman:
"Use Postman proxy" it should be set to No.
I use postman with this setting and localhost uri's work well for me..

Related

IIS: front end server not connecting to website

I am newer to IIS so please forgive my ignorance. Here is my situation. I have a backend server that resides on ip xx.xx.xx.175 from here I have all my code and IIS installed here. I created a website and can access it just fine using localhost:3000. When I go to the frontend server which resides at xx.xx.xx.174 I cannot connect to the site using the URL.
I have updated the bindings, I have updated the firewall rules, I have also used netsh http add iplisten and I still cannot connect to the site. I am not sure where else to go from here as all of my Google searching lead me to the same things.
Please make sure you have added the ip address in the host file:
Open your text editor in Administrator mode.
In the text editor, open C:\Windows\System32\drivers\etc\hosts.
Add the IP Address and hostname. Example: 192.10.10.5 testserver.com.
Save the changes.

IIS Url Rewrite query string limit problem

Please help :)
We have a web project. Frontend and backend. Windows Server 2019 IIS8
A problem is that we have a SSL certificate only for subdomain xxx.xxx.de (This we cant change)
Frontend work over https. Backend is on some server running, but we can not reach server over https.
Only over http.
Me idea was use Url Rewrite. That even works, but!!!
URL Rewrite Module has query string limit.
Anything over 3000 characters will be cut off!!
Does anyone know the problem?
Upd:
I made all settings for IIS for requestfilter over all maxlength and http sys in registery. If I only try over http, without url rewrite, then everything works with a 9000 byte query string. As soon as I turn on url rewrite, the query is cut off
There isn’t a query string limitation on URL rewrite module.
There are 2 related settings you can try:
Request filtering limitation and HTTP Runtime configuration.
HTTP.sys settings
Reference this official document: Http.sys registry settings for Windows - Internet Information Services | Microsoft Learn.
HTTP.sys can be configured by registry. You can create the following DWORD registry values under the following registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters

How to setup a reverse proxy in IIS using host file?

I'm trying to setup a reverse proxy in IIS 10 using some fake urls.
In my host file I set up :
127.0.0.1 somedomain.com
Then I created a website in IIS 10 binding to this domain and a fake page :
When typing somedomain.com on chrome, the fake page shows properly. I assume the fake domain website works.
I have then another website with a reverse proy rewrite rule. I expect requests to the new website to be rewritten and show the first somedomain.com
When running my reverse proxy website I'm getting the error :
HTTP Error 400.605 - Bad Request
The request cannot be routed because it has reached the Max-Forwards limit. The server may be self-referencing itself in request routing topology.
Does anyone know what I'm doing wrong please ?
I tried changing the rule action type to "Redirect" and I can see that the redirection works correctly.

Network Error (React-Native, Express,Nodejs,MongoDB)

I am getting a Network Error while calling my server(nodejs) API.
I have rechecked my localhost, server, and port.
They are all working fine. I have also confirmed using POSTMAN and also ran the server on the web locally to fetch data.
I think I have also added the cors properly in my server.js file.
Want some help on this.
I have also tried with dummy API and they worked fine.
My imports from front-end
Here is LogCat
Response Header in Postman
ngrok status
Hi I think you can try exposing your local host to the internet using a service like ngrok which will generate a url for you, and then try using the url to send requests instead of localhost:3000. Simply download and follow the instructions here: https://ngrok.com/docs
It seems that you are having a problem in react native code, not in backend. That's why you are not getting any error in postman.
I am guessing that you are importing the dependencies is problematic way.
if you are trying to use local server API in mobile application development, all you need to do is replace "localhost" in the URL with your pc IP address. This worked for me.

Application Request Routing: Why some sites return HTTP 404 some don't?

I want to add a load balancer to an existing asp.net project using Application Request Routing. So I made myself familiar with the concepts and created a local test-setup:
IIS locally running on Windows 10:
Installed Application Request Routing 3.0 with Windows Platform Installer
Created server farm with following servers:
<test-server-name>.de (Microsoft 2012 R2 Server: contains the asp.net project)
www.google.com (just to see if load balancing and url rewriting works because I don't have two test servers available)
URL-Rewriting rule:
After typing localhost multiple times in any browser, I can see that load balancing (weighted round robin) is working fine. It's alternating between 1. and 2. website.
The problem I'm facing is a 404 Error on both websites.
I already tried the following:
Installing and enabling Failed Request Tracing Rules (on local IIS): URL Rewriting is working properly i think.
Failed Request Log for www.google.com: google drive, unzip and open xml in e.g. IE for better view
Create Server Farm without automatic creation of URL Rewrite rules
(selecting No and create own URL Rewrite rule)
Change "Managed Pipeline Mode"-setting of Applcation Pool from Integrated to Classic
Healthcheck on other Websites I have absolutly no clue why it's working on Git-websites and why facebook is returning a 400 error code.
Enabling/disabling proxy (IIS-Manager -> Application Request Routing Cache -> Server Proxy Settings...)
I don't know what i could do next, so I appreciate any help. Thanks.
Answer can be found here: https://forums.iis.net/t/1238739.aspx?Why+some+sites+return+HTTP+404+some+don+t+
Some websites simply don't support localhost as hostname, which is why localhost can't be found (error 404) e.g. on google.com
Detailed answer if link above is not working in future:
That is not an effective test.
What you are doing is sending the hostname of your request to the third party servers. Like Google.
So if your request is say http://example.com you are sending this to say www.google.com and the Google servers will likely reject this as you can see
Web server admins generally don't let themselves receive traffic from domain thet do not host.
If you sent a request to my servers IP with mysite.com I too would likely reject it. (Things get complex if you have wildcard sites and you allow all traffic through)
But simply showing that 404 page from Google means tour request hit there server so that implies ARR is working.
If you really wanted to test it this way have a local host file with www.google.com resolving to your servers IP. Set up a site with www.google.com as the hostheader and then you should see the correct info hitting Google. But there is no accounting for what 3rd party admins do on their side.

Resources