<IfModule mod_ssl.c>
<VirtualHost *:443>

ServerAdmin webmaster@localhost

ServerName live.fukeyeducation.com
ServerAlias www.fukeyeducation.com
#DocumentRoot /var/www/html/jupitermeet_pro/public
DocumentRoot /var/www/html/lsservervideo/public
#DocumentRoot /var/www/html/lsvideochat
<Directory /var/www/html/lsservervideo/public>
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted    
 </Directory>

#DocumentRoot /var/www/html/lsvideochat

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

# Redirect permanent / https://live.rahulshrivastava.in/
    ProxyRequests off
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyPreserveHost On
    RewriteEngine on
   RewriteCond %{HTTP:Connection} Upgrade [NC]
   RewriteCond %{HTTP:Upgrade} websocket [NC]
    <Location "/">
        Order allow,deny
        Allow from all
        ProxyPass https://localhost:9002/
        ProxyPassReverse https://localhost:9002/
        RewriteEngine on
        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteCond %{HTTP:Connection} upgrade [NC]
        RewriteRule ^/?(.*) wss://localhost:9002/$1 [P,L]
        #RewriteRule ^/?(.*) http://localhost:9002/$1 [P,L]
    </Location>
    
    <Location "/socket.io/socket.io.js">
        #Order allow,deny
        #Allow from all
        # This is needed to handle the websocket transport through the proxy, since
        # etherpad does not use a specific sub-folder, such as /ws/ to handle this kind of traffic.
        # Taken from https://github.com/ether/etherpad-lite/issues/2318#issuecomment-63548542
        # Thanks to beaugunderson for the semantics
        #RewriteEngine On
        RewriteEngine on
        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteCond %{HTTP:Connection} upgrade [NC]
        RewriteRule ^/?(.*) wss://localhost:9002/$1 [P,L]
        #RewriteRule ^/?(.*) http://localhost:9002/$1 [P,L]
    </Location>

    <Location "/dash">
        ProxyPass "!"
        Order allow,deny
        Allow from all
    </Location>
    <Location "/api">
        ProxyPass "!"
        Order allow,deny
        Allow from all
    </Location>
    <Location "/server">
        ProxyPass "!"
        Order allow,deny
        Allow from all
    </Location>
    <Location "/css">
        ProxyPass "!"
        Order allow,deny
        Allow from all
    </Location>
#Redirect permanent / https://live.rahulshrivastava.in

SSLCertificateFile /etc/letsencrypt/live/live.fukeyeducation.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/live.fukeyeducation.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
