Roots Discourse

Nginx SSL Reverse Proxy

Hey there,

I have a standard Wordpress Site running with SSL on a Digitalocean Droplet deployed with trellis.
A child nginx config is set up to add a listener on a specific port to proxy to my node.js App, but the server rejects the connection to my running node.js application.

My Child config:
{% extends ‘roles/wordpress-setup/templates/wordpress-site.conf.j2’ %}

{% block server_before -%}
server {
  listen [::]:21000 ssl;
  listen 21000 ssl;
  server_name example.com;

  access_log   /srv/www/example.com/logs/saccess.log;
  error_log    /srv/www/example.com/logs/serror.log;

  # SSL configuration
  include h5bp/directive-only/ssl.conf;
  include h5bp/directive-only/ssl-stapling.conf;
  ssl_dhparam /etc/nginx/ssl/dhparams.pem;
  ssl_buffer_size 1400; # 1400 bytes to fit in one MTU

  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; ";
  ssl_certificate         /etc/nginx/ssl/letsencrypt/example.com-bundled.cert;
  ssl_certificate_key     /etc/nginx/ssl/letsencrypt/example.com.key;

  include acme-challenge-location.conf;

  include includes.d/all/*.conf;
  include includes.d/example.com/*.conf;

  location / {
    rewrite ^/(.*) /$1 break;
    proxy_pass http://127.0.0.1:2222;
    proxy_redirect     off;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto https;
  }
}

{% endblock %}

Does anyone have an solution?
On my local machine with vagrant it is working.

Greetings,

Steffen