Welcome! Log In Create A New Profile

Advanced

nginx reverse proxy/load balancing to IIS host header

Posted by azzurro77 
nginx reverse proxy/load balancing to IIS host header
December 26, 2013 11:00PM
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
Re: nginx reverse proxy/load balancing to IIS host header
December 26, 2013 11:03PM
Correction the line "proxy redirect default;" was removed from the config
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready