Redirect http->https on ns.dom.tld

Discussion in 'Installation/Configuration' started by francoisPE, Jun 27, 2021.

  1. francoisPE

    francoisPE Member HowtoForge Supporter

    Hello,
    I have ispconfig 3.2.4 on ubuntu 20.04 servers.
    I set up a website called ns.dom.tld.
    I reach ispconfig web interface through : ns.dom.tld:8080
    My server_ip is '*' for all websites
    My sites have all ssl (LE) and works
    I remove seo redirect from my website ns.dom.tld.
    in ns.dom.tld.whost there is
    Code:
            RewriteEngine on
            RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
            RewriteRule ^ - [END]
            RewriteCond %{HTTPS} off
            RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
    My ssl links are
    ls /*/*/ns.dom.tld/ssl
    ns.dom.tld-le.key -> /etc/letsencrypt/live/ns.dom.tld/privkey.pem
    ns.dom.tld-le.crt -> /etc/letsencrypt/live/ns.dom.tld/fullchain.pem
    ns.dom.tld-le.bundle -> /etc/letsencrypt/live/ns.dom.tld/chain.pem
    and for ispconfig
    /usr/local/ispconfig/interface/ssl/ispserver.key -> /etc/letsencrypt/live/ns.dom.tld/privkey.pem
    /usr/local/ispconfig/interface/ssl/ispserver.crt -> /etc/letsencrypt/live/ns.dom.tld/fullchain.pem

    I think there is a conflict between configuration files :
    /etc/apache2/sites-available/ns.dom.tld.vhost
    /etc/apache2/sites-available/ispconfig.conf

    Am I correct ?
    Is there a way to solve that ?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I don't see any as you only show multiple symlinks which should all be fine to me. What is your error actually?
     
  3. francoisPE

    francoisPE Member HowtoForge Supporter

    yes, my symlink seems ok
    I think there is a conflict between configurations :
    /etc/apache2/sites-available/ns.dom.tld.vhost
    /etc/apache2/sites-available/ispconfig.conf
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    And what is that conflict?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    That's ok, just two vhosts that have symlinks pointing to the same SSL certificate.
     
  6. francoisPE

    francoisPE Member HowtoForge Supporter

    I don't understand why redirect http to https doesn't work in that situation
     
  7. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

     
  8. francoisPE

    francoisPE Member HowtoForge Supporter

    yes
    but I select
    upload_2021-6-30_14-27-3.png

    In this forum, I saw that seo redirect could be a problem being in between "acme and https" in vhost conf file
    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
    RewriteRule ^ - [END]
    (x) here I mean
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
     
  9. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    My knowledge in apache2 is a bit rusty but I know that there is two ways in doing so that is either add them into vhost (under port 80) or .htacess file (in your site root folder) but you have to check whether you are using the right one.

    If you use it with ISPConfig I would suppose it should be automatically added in the vhost unless that failed and kept into error file instead.
     
  10. francoisPE

    francoisPE Member HowtoForge Supporter

    Absolutely

    As you see, it is in vhost
    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
    RewriteRule ^ - [END]
    (x) here I mean
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
    but it is not effective...
    redirection doesn't work !
     

Share This Page