CONFIG APACHE SSL

Discussion in 'Apache' started by Oliver Tangari, Nov 18, 2019.

  1. #1
    I have a live app running on port :8080

    I managed to secure my site and redirect the app to listen on port 80 (http://142.93.118.89/#/dashboard), however when I tried to setup a ProxyPassReverse it doesn't work.

    What Am I doing wrong here? Why can't I access https://www.ofornecedor.com.br?

    Thanks

    
    
    root@ubuntu-suppliers:/etc/apache2/sites-available# cat ofornecedor.com.br-le-ssl.conf
    <IfModule mod_ssl.c>
    <VirtualHost *:443>
    # ServerAdmin webmaster@localhost
    # ServerName ofornecedor.com.br
    # ServerAlias www.ofornecedor.com.br
    # DocumentRoot /var/www/ofornecedor.com.br
    # ErrorLog ${APACHE_LOG_DIR}/error.log
    # CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    ServerName ofornecedor.com.br
    ServerAlias www.ofornecedor.com.br
    
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    
    
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/ofornecedor.com.br/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/ofornecedor.com.br/privkey.pem
    </VirtualHost>
    </IfModule>
    
    root@ubuntu-suppliers:/etc/apache2/sites-available# cat ofornecedor.com.br.conf
    <VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    # ServerAdmin webmaster@localhost
    ServerName ofornecedor.com.br
    ServerAlias www.ofornecedor.com.br
    # DocumentRoot /var/www/ofornecedor.com.br
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =ofornecedor.com.br [OR]
    RewriteCond %{SERVER_NAME} =www.ofornecedor.com.br
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    </VirtualHost>
    root@ubuntu-suppliers:/etc/apache2/sites-available#
    Code (markup):


    Thanks
     
    Last edited by a moderator: Nov 18, 2019
    Oliver Tangari, Nov 18, 2019 IP
  2. FaveHosting

    FaveHosting Active Member

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    60
    #2
    SSL listen on port 443 not 80
     
    FaveHosting, Nov 18, 2019 IP
  3. Oliver Tangari

    Oliver Tangari Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Hey Fave.

    Thanks for your reply.

    So what Am I doing wrong here?

    I also defined ProxyPass under port 443.

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    Code (markup):

    Why Am I able to access the site with the IP address but not with DNS name?

    Thanks!
     
    Oliver Tangari, Nov 19, 2019 IP
  4. FaveHosting

    FaveHosting Active Member

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I'm not a proxy expert unfortunately I am a web host but DNS are listening on port 53 usually. Do you have a firewall blocking ports?
     
    FaveHosting, Nov 19, 2019 IP
  5. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #5
    Ensure that all necessary Apache modules are enabled on your server:
    sudo a2enmod proxy
    sudo a2enmod proxy_http
    sudo a2enmod proxy_balancer
    Code (markup):
    If you are still getting the error, check the Apache error log for more details.
     
    RoseHosting, Nov 20, 2019 IP