0

I'm trying to make rewrite rules to my nginx server. I have the following configuration on the IIS side: IIS URL Rewrite config That part works fine, When I go to (ex. www.website.com) I get the page from my nginx webserver but just the default page not the site. if I put www.website.com in my host file and send it to the NGINX server then I get the correct site, so my guess is that for some reason NGINX doesn't get the host url/name from the IIS server or doesn't understand the request.

previously each site ran on a different port on the NGINX server but that was unacceptable, I don't know why the did it but they can't expect me to just open 20+ ports from the dmz to the LAN for this all traffic has to go over port 80.

Currently we have 1 routing server in the dmz this one routes to the IIS or NGINX servers based on url rules from and to IIS work fine as expected but NGINX does't work the way we need it, now it works because every website runs on a different port which is insane.

Is there something that we can do to fix this, is it just a limitation of one of the servers. without the IIS rewrite NGINX behaves as we like and it servers the correct site for every url, when we add the rewrite in between we can only see the default page.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • I dont understand the config image you attached. Can you use something like cURL to show what is being returned by the servers (and exclude the html). For instance try, use curl or wget: `curl -s -v -o testfile "http://www.website.com"` – spacepickle Apr 21 '17 at 14:12
  • The config is the rewrite config in IIS, if i use curl to get test.txt it gives me a 404 error unless I have 'www.website.com 192.168.16.154' in my host file, if the request goes from the arr server it gives a 404 – Jamie Vangeysel Apr 21 '17 at 14:25
  • As this is really a config question, you might have more luck on www.serverfault.com If you do decide to ask a question over there, your idea of showing different test cases (ie without hosts file; with hosts file;) is good, so try reformatting your question around that idea with each test as a clear chunk showing the curl output (including the `-v` output) explaining what the test is supposed to show and what you believe is wrong in each case - whatever you do though, dont post that here – spacepickle Apr 21 '17 at 14:50
  • I found the answer in this post https://stackoverflow.com/questions/14841986/iis-aar-url-rewrite-for-reverse-proxy-how-to-send-http-host#answer-14842856 – Churix May 28 '20 at 09:42

0 Answers0