Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx reverse proxy/load balancing to IIS host header

$
0
0
Hi everyone,

I'm having trouble accessing a IIS site (with host header) through nginx. I get a 404 (HTTP Error 404. The requested resource is not found.)

Here is the setup I did.

Nginx 1.1.19 setup has reverse proxy for IIS
IIS site set up with host header.

nginx config file :


upstream backend {
server acme01.subdomain.domain.com;
}

# HTTPS server

server {
listen 443;
server_name test.acme.com;

error_log /var/log/nginx/error_test.acme.com.log;
access_log /var/log/nginx/access_test.acme.com.log;

ssl on;
ssl_certificate /etc/nginx/ssl/test.acme.com/chained_test.acme.com.crt;
ssl_certificate_key /etc/nginx/ssl/test.acme.com/test.acme.com.key;

ssl_session_timeout 5m;

ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;

location / {
proxy redirect default;
proxy_set_header x-real-IP $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header host $http_host;
proxy_pass http://backend/;
}
}

When I remove the host header from IIS and change the "server name" from nginx, wth the IIS server name is goes throught but as soon I put back the original config, it fails with 404.
I can access acme01.subdomain.domain.com from a web browser and it works.

I've been searching for weeks to find a solution but with no luck.

Can someone check out my nginx config and tell me whats wrong with it?

Thank you for your help

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>