How to setup SSL with port other than 443

My version of HedgeDoc is: 1.9.9

What I expected to happen:

I tried to setup HedgeDoc 1.9.9 with reverse proxy over SSL, and I want to use port 8000 other than default 443, as port 443 is forbidden by my IT policy.

What actually happened:

My Apache conf:

Listen 8000
SSLCryptoDevice builtin
<VirtualHost *:8000>
  ServerName      plm.abc.com
  ServerAlias     plm.abc.com

  ErrorLog        /var/log/httpd/hedge_error_log.txt
  TransferLog     /var/log/httpd/hedge_access_log.txt

  LogLevel warn
  SSLEngine on
  SSLProxyEngine on

  RewriteEngine on
  RewriteCond %{REQUEST_URI} ^/socket.io             [NC]
  RewriteCond %{HTTP:Upgrade} =websocket             [NC]
  RewriteRule /(.*)  ws://127.0.0.1:3000/$1          [P,L]

  ProxyPass / http://127.0.0.1:3000/
  ProxyPassReverse / http://127.0.0.1:3000/

  RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

  SSLCertificateFile      conf/ssl/cert_plm.abc.com/plm.abc.com.crt		##self assigned certificate
  SSLCertificateKeyFile   conf/ssl/cert_plm.abc.com/plm.abc.com.key

</VirtualHost>

I already tried:

I tried to modify config.json as: “domain”: “plm.abc.com:8000”, and can create guest notes.
But failed to register new user: after input email and password and click Register button, no user created and cannot sign in.

My HedgeDoc config.json:

{
"production": {
        "domain": "plm.abc.com:8000",
        "urlAddPort":false,
        "useSSL":false,
        "protocolUseSSL":true,
        "loglevel": "info",
        "cookiePolicy": "lax",
        "db": {
            "username": "xxxxxx",
            "password": "xxxxxx",
            "database": "hedgedoc",
            "host": "127.0.0.1",
            "port": "3306",
            "dialect": "mariadb"
        },

        "sessionSecret":"hedgedoc",
        "linkifyHeaderStyle": "gfm"
    }
}

Hi @xiaoxi,

unfortunately your use-case isn’t really supported. HedgeDoc generates own URLs based on the configured port or omitting the port completely. Specifying a custom port is not possible.

In future releases (2.0) this will probably change.

In the meantime you could fall back to using HedgeDoc’s own SSL mode, where the instance itself is running with HTTPS on the configured port.
However, this is not as customizable as a reverse-proxy, and usually not recommended.