Welcome! Log In Create A New Profile

Advanced

Nginx reverse proxy for IIS server

Posted by efiten 
Nginx reverse proxy for IIS server
February 07, 2020 05:00AM
I have a windows IIS server with several subdomains :
sub1.domain.com
sub2.domain.com
sub2.domain.com
All domains are secured with a (wildcard) SSL certificate

Now I want to setup an NGINX proxy on a different Linux machine.

Maybe this is a newbe question, but how do I set this up ?

1. I need to point the 'sub1.domain.com' domain to the IP of the NGINX proxy server
2. what do I need to setup in the nginx server? Because the IIS server only listens to request coming from the correct domain? I don't think I can set the 'server_name' and 'proxy_pass' name the same, because the subdomainname point to the proxy, and not the actual IIS server where it needs to go.

this is an example of my config :

server {
listen 443 ssl;
server_name sub1.domain.com;

ssl_certificate /etc/ssl/mycert.cer;
ssl_certificate_key /etc/ssl/mykey.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
proxy_pass https://sub1.domain.com;
}
}


In what way do I get this working ?

Erwin
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready