Welcome! Log In Create A New Profile


Remote Desktop Gateway behind NGINX Reverse Proxy

Posted by allinformatix 
Remote Desktop Gateway behind NGINX Reverse Proxy
May 12, 2016 03:09PM
Hello @ all,

maybe my question has already been asked and some one can lead me to the wright Post.

I am new to NGINX and very convinced and also positivly surprised about this program. I have now the challange to run our RD-GateWay behind this Proxy. The problem is, how I can mange to forward all the RPC/HTTPS traffic. Attched you will see how I want to configure our ReverseProxy

My Config (a ServerBlock) "my.domain.com.conf" for the Remote Desktop Gateway:

upstream rdp {
server {
listen 443;
server_name my.domain.com;

ssl on;

ssl_certificate /path/to/cert/cert.pem;
ssl_certificate_key /path/to/key/key.pem;

keepalive_timeout 60;

ssl_ciphers HIGH:!ADH:!MD5;
ssl_protocols SSLv3 TLSv1;
ssl_prefer_server_ciphers on;

location / {
proxy_pass https://rdp;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;

Thanks for your Help in Advanced!

open | download - ReverseProxy_Problem.pdf (157.3 KB)
Re: Remote Desktop Gateway behind NGINX Reverse Proxy
May 12, 2016 04:04PM
You can't share a https and stream on the same port, either only use stream or use a different port with stream.
RDP needs stream as its TCP and not HTTP(s).

# load balance your rdp servers via port 444

worker_processes 2;
error_log logs/error.log;

events {
worker_connections 16384;

# http {
# ... your usual http block ...
# } # http end

stream {
error_log logs/stream_error_rdp.log;

upstream backend {
hash $remote_addr consistent;

server {
listen 444 so_keepalive=on;
proxy_connect_timeout 300s;
proxy_timeout 300s;
proxy_pass backend;


nginx for Windows http://nginx-win.ecsds.eu/

Edited 1 time(s). Last edit at 05/12/2016 04:05PM by itpp2012.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
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