LetsEncrypt for Subdomain and too long username error

Discussion in 'Installation/Configuration' started by Poliman, Jul 26, 2017.

  1. Poliman

    Poliman Member

    Is it possible to setup LetsEncrypt SSL for created subdomain? Second thing - I have error when try create database user. Is it possible to make it longer?
     

    Attached Files:

  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I think it will be automated if main website is LE enabled.

    Otherwise you may use subdomain (vhost) for individual LE ssl certs.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    As @ahrasis pointed out, sub and alias domains of a website get added automatically to the LE cert of the website.
     
  4. Poliman

    Poliman Member

    Main website (let's say domain.com) has LE enabled and works properly with redirect from http to https. I created subdomain (let's say testh.domain.com) which will be on nodejs. Main directory of subdomain is /web/testh (/web/ is default public directory of main domain). There is application based on nodejs which use some port, default 3000. http://testh.domain.com redirect automatically to https:// and it is like with main domain. But when I put in address bar https://testh.domain.com:3000 (without https it works) green padlock changes to exclamation mark and I got message that browser can't open it with error ERR_CONNECTION_CLOSED (on Chrome) or that browser can't form secure connection (on Firefox). I think if I would setup LE for subdomain or use vhost (still not visible vhost option for alias and subdomains in ISP panel) I could open https://testh.domain.com:3000 without any problem. Moreover I could - for vhost option - easily setup ProxyPass which would hide nodejs port in URL, which is visible by default.

    PS
    Attached screen shows which options I have available in Sites tab. Second thing that after subdomain creation using option "Subdomain for website" I have line in main domain vhost file 100-domain.com.vhost, for *80 and *443:
    Code:
    ServerName domain.com #it was by default
    ServerAlias www.domain.com #it was by default
    ServerAlias testh.domain.com #added automatically after create subdomain
    
    And what exactly are differences between subdomain/aliasdomain and subdomain/aliasdomain vhost?
     

    Attached Files:

    Last edited: Jul 26, 2017
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    When you connect directly to port 3000 like that, you are talking to your nodejs server, not to your webserver (apache or nginx); it is the webserver, not nodejs, which is configured with an ssl certificate. Instead of redirecting testh.domain.com to testh.domain.com:3000, you need to configure a reverse proxy connection (so your browser will access https://testh.domain.com/ and the web server will proxy the connection to port 3000).
     
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I explained it a bit in reply to your other thread.
     
    Poliman likes this.
  7. Poliman

    Poliman Member

    Much thanks. ;)
    For this I need vhost for subdomain and inside it ProxyPass and ProxyPassReverse from testh.domain.com:3000 to /, am I right? Can somebody tell me what about (added line in main domain vhost) my PostScriptum from last post? ;)

    PS
    I removed subdomain from "Subdomain for website" and added under "Subdomain (vhost)". Unfortunatelly subdomain is not under ssl. I should check both options LE SSL and SSL. Second thing that without check "Rewrite HTTP to HTTPS" subdomain is redirected like main domain.
     
    Last edited: Jul 27, 2017

Share This Page