Summer-16 / CSGO-VMPanel

A Fully automated VIP Management panel for CSGO Community servers
GNU General Public License v3.0
86 stars 19 forks source link

Force HTTPS protocol for whole panel #29

Closed TandelK closed 2 years ago

TandelK commented 3 years ago

Is your feature request related to a problem? Please describe. Well currently the panel indirectly runs on http protocol would recommend it to force to SSL HTTPS method.

Describe the solution you'd like Integrate it HTTPS SSL support directly inside nodejs panel server

TandelK commented 3 years ago

@Summer-16 I did follow this guide but wasnt able to get the Proxy Server working properly.

https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener

Summer-16 commented 3 years ago

Just create a virtual host in your Apache server using the config provided in readme.

TandelK commented 3 years ago

@Summer-16 The Proxy does not work properly with SSL Apache Config. Can you help me setting it up.

shaikhnedab commented 3 years ago

@TandelK can you share your sites-available config of this panel? also join Discord for quick support.

TandelK commented 3 years ago

@shaikhnedab @Summer-16 Can you guys give us one Format for Apache Proxy for SSL Configuration ?

rafalolszewski94 commented 3 years ago

Use nginx instead of apache and use this tool if you don't know how to set it up your self https://www.digitalocean.com/community/tools/nginx

TandelK commented 3 years ago
<VirtualHost *:80>
 ServerAdmin webmaster@localhost
 ServerName vip.domain.com
 ProxyRequests off

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    <Location />
        ProxyPass http://localhost:2095/
        ProxyPassReverse http://localhost:2095/
    </Location>

</VirtualHost>

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName vip.domain.com

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        SSLEngine on
        SSLCertificateFile  /etc/ssl/domain.com.crt
        SSLCertificateKeyFile /etc/ssl/domain.com.key

        ProxyRequests off

       <Proxy *>
           Order deny,allow
           Allow from all
       </Proxy>

       <Location />
           ProxyPass http://localhost:2095/
           ProxyPassReverse http://localhost:2095/
       </Location>

    </VirtualHost>
</IfModule>

How do i make http to redirect to https ? I tried using Redirect Permanent "/" "https://vip.domain.com" but it goes on Loop.

jastisriradheshyam commented 3 years ago

Try this:

<VirtualHost *:80>
 ServerAdmin webmaster@localhost
 ServerName vip.domain.com:80
 ServerAlias vip.domain.com
 Redirect / https://vip.domain.com
</VirtualHost>

<IfModule mod_ssl.c>
  <VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName vip.domain.com:443
    ServerAlias vip.domain.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLEngine on
    SSLCertificateFile  /etc/ssl/domain.com.crt
    SSLCertificateKeyFile /etc/ssl/domain.com.key

    ProxyPassReverse / http://localhost:2095/
    <Location />
      Allow from all
    </Location>
  </VirtualHost>
</IfModule>

Required modules if not installed:

e2enmod ssl
e2enmod headers
e2enmod proxy_http