<VirtualHost *:443>
    ServerName hub.enterpriseapplicationdevelopers.com

    SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/hub.enterpriseapplicationdevelopers.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hub.enterpriseapplicationdevelopers.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
    DocumentRoot /var/www/html/hub/hub/

    <Directory /var/www/html/hub/hub/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

 RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
    ProxyPreserveHost On
    ProxyPass / http://localhost:8082/
    ProxyPassReverse / http://localhost:8082/

  ProxyPass /api http://127.0.0.1:8985/api
    ProxyPassReverse /api http://127.0.0.1:8985/api

    ProxyPass /uploads http://127.0.0.1:8985/uploads
    ProxyPassReverse /uploads http://127.0.0.1:8985/uploads

 # ProxyPass /api http://127.0.0.1:8985/api 
  #  ProxyPassReverse /api http://127.0.0.1:8985/api

#    ProxyPass /uploads http://127.0.0.1:8985/uploads
#    ProxyPassReverse /uploads http://127.0.0.1:8985/uploads

#    RewriteEngine On
 #   RewriteCond %{REQUEST_FILENAME} !-f
 #   RewriteCond %{REQUEST_FILENAME} !-d
 #   RewriteRule ^ /index.html [L]
RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/api
    RewriteCond %{REQUEST_URI} !^/uploads
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
#    RewriteRule ^ /index.html [L]

RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:8082/$1 [P,L]
ErrorLog ${APACHE_LOG_DIR}/ims-error.log
    CustomLog ${APACHE_LOG_DIR}/ims-access.log combined

</VirtualHost>
