Skip to content

Instantly share code, notes, and snippets.

@4nh51rk
Forked from vbalexr/apache-thingsboard.conf
Created December 24, 2021 06:50
Show Gist options
  • Select an option

  • Save 4nh51rk/46174e6e66491d609145c18de0929f83 to your computer and use it in GitHub Desktop.

Select an option

Save 4nh51rk/46174e6e66491d609145c18de0929f83 to your computer and use it in GitHub Desktop.
Apache proxy ssl thingsboard
<VirtualHost *:443>
ServerAdmin "EMAIL ADMIN"
DocumentRoot /var/www/html
ServerName "SERVERNAME"
ProxyRequests off
ProxyPreserveHost On
#Redireccion de wss a ws
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule .* "ws://localhost:9201%{REQUEST_URI}" [P]
#Redireccion de https(443) a 8080 mostrar maintenace.html en caso de error
ProxyPass /maintenance.html !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
#Archivos de bitacora
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#Configuracion de SSL
SSLEngine on
SSLCertificateFile "CERTFILE"
SSLCertificateKeyFile "KEYFILE"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment