vHost apache pour vCenter

<VirtualHost *:80>
	ServerName __monserveurname__

	RewriteEngine On
	RewriteCond %{HTTPS} off
	RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
	RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

	TransferLog ${APACHE_LOG_DIR}/error.log
	ErrorLog ${APACHE_LOG_DIR}/access.log
</VirtualHost>
<IfModule mod_ssl.c>
	<VirtualHost *:443>
		ServerName __monserveurname__

		SSLEngine on
		SSLCertificateFile /__votre SSL __crt
		SSLCertificateKeyFile /__votre SSL __.key

		SSLProxyEngine On
		SSLProxyVerify none
		SSLProxyCheckPeerCN Off
		SSLProxyCheckPeerName Off

		ProxyPass / https://__FQDN ou IP__/
		ProxyPassReverse / https://__FQDN ou IP__/

		RewriteEngine On
		RewriteCond %{REQUEST_URI} ^/ticket [NC,OR]
		RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
		RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
		RewriteRule .* wss://__FQDN ou IP__%{REQUEST_URI} [P,QSA,L]
		RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
		RewriteRule .* https://__FQDN ou IP__%{REQUEST_URI} [P,QSA,L]

		TransferLog ${APACHE_LOG_DIR}/access.log
		ErrorLog ${APACHE_LOG_DIR}/error.log
	</VirtualHost>
</IfModule>

 

Autre configuration trouver : (ne me convient pas)

 

<VirtualHost *:80>
	ServerName __monserveurname__

	RewriteEngine On
	RewriteCond %{HTTPS} off
	RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
	RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

	TransferLog ${APACHE_LOG_DIR}/error.log
	ErrorLog ${APACHE_LOG_DIR}/access.log
</VirtualHost>
<IfModule mod_ssl.c>
	<VirtualHost *:443>
		ServerName __monserveurname__

		SSLEngine on
		SSLCertificateFile /__votre SSL __crt
		SSLCertificateKeyFile /__votre SSL __.key

		SSLProxyEngine On
		SSLProxyVerify none
		SSLProxyCheckPeerCN Off
		SSLProxyCheckPeerName Off

#### Si le nom du vcenter local est différent du public, il faut réécrire les URL :
		
# Changer la destination d'accès intégrée dans le javascript de la réponse de vCenter 
# Si vous ne réécrivez pas le corps de la réponse, vous vous connecterez avec l'adresse vCenter du backend au lieu du proxy inverse
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute s/vcenter.pcc.inetworks.fr:PORT_LOCAL/vcenter.pcc.inetworks.fr:PORT_PUBLIC/n

# L'en-tête Location doit également être réécrit pour accéder au proxy inverse
    Header edit* Location vcenter.pcc.inetworks.fr:PORT_LOCAL vcenter.pcc.inetworks.fr:PORT_PUBLIC		

		 ProxyPreserveHost Off
         ProxyRequests Off

                <LocationMatch /(.*)>
                      ProxyPass https://__FQDN ou IP__:PORT_LOCAL/$1
                      ProxyPassReverse https://__FQDN ou IP__:PORT_LOCAL/$1
                </LocationMatch>

                <LocationMatch /ui/webconsole/authd(.*)>
                      ProxyPass wss://__FQDN ou IP__/ui/webconsole/authd$1
                      ProxyPassReverse wss://__FQDN ou IP__/ui/webconsole/authd$1
                </LocationMatch>

                <LocationMatch /vsphere-client/endpoints/webconsole/authd(.*)>
                      ProxyPass wss://__FQDN ou IP__/vsphere-client/endpoints/webconsole/authd$1
                      ProxyPassReverse wss://__FQDN ou IP__/vsphere-client/endpoints/webconsole/authd$1
                </LocationMatch>

                <LocationMatch /ui/messaging>
                      ProxyPass wss://__FQDN ou IP__/ui/messaging
                      ProxyPassReverse wss://__FQDN ou IP__/ui/messaging
                </LocationMatch>

                <LocationMatch /ui/live-updates>
                      ProxyPass wss://__FQDN ou IP__/ui/live-updates
                      ProxyPassReverse wss://__FQDN ou IP__/ui/live-updates
                </LocationMatch>

		TransferLog ${APACHE_LOG_DIR}/access.log
		ErrorLog ${APACHE_LOG_DIR}/error.log
	</VirtualHost>
</IfModule>