Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 28/10/2016, à 11:49

iuchiban

Apache2 - Configuration rewriterule + proxypass

Bonjour tout le monde,

Je cherche un peu d'aide pour arriver à configurer mon proxy apache.

Mon matos :
serveur apache httpd en Listen sur le port 8090 (à cause de "j'y accède via un VPN)
ServerRoot       /etc/httpd
DocumentRoot /var/ww/html

J'ai installé elasticsearch et kibana.
kibana écoute sur le port 5601
si je curl ip:5601 :

# curl http://a.b.c.d:5601
<script>var hashRoute = '/app/kibana';
var defaultRoute = '/app/kibana';

var hash = window.location.hash;
if (hash.length) {
  window.location = hashRoute + hash;
} else {
  window.location = defaultRoute;
}</script>

J'ai aussi déployé deux applis pour gérer elasticsearch dans /var/www/html :
- elasticsearch-head
- elasticsearch-HQ

Maintenant, j'aimerais pouvoir :

quand je tape http://a.b.c.d:8090/kibana => http://a.b.c.d:5601/
quand je tape http://a.b.c.d:8090/elasticsearch-head => /var/www/html/elasticsearch-head
quand je tape http://a.b.c.d:8090/elasticsearch-HQ => /var/www/html/elasticsearch-HQ

Pour les deux applis elasticsearch, c'est du standard.
Maintenant, sur la partie /kibana :
- je set le server.basepath: /kibana :

# Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects
# the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests
# to Kibana. This setting cannot end in a slash.
server.basePath: "/kibana"

et quand je curl j'ai bien l'ajout dans l'URL :

curl http://a.b.c.d:5601
<script>var hashRoute = '/kibana/app/kibana';
var defaultRoute = '/kibana/app/kibana';

var hash = window.location.hash;
if (hash.length) {
  window.location = hashRoute + hash;
} else {
  window.location = defaultRoute;
}</script>

Mais c'est sur les rewrite / proxy que je sèche.

J'imagine que ça doit être quelque chose comme ça :

<Location ^/kibana>
#ProxyPass         / http://a.b.c.d:5601/
#ProxyPassReverse  / http://a.b.c.d:5601/
  RewriteEngine On
  RewriteRule "^/kibana/(.*)" "http://a.b.c.d:5601/$1" [P]
</Location>

Si vous avez des idées de configuration, je suis preneur.

Merci.

Dernière modification par iuchiban (Le 28/10/2016, à 11:49)


C'est depuis que Chuck Norris a laissé la vie sauve à un manchot que l'on dit que Linux est libre.

Chuck Norris n'a pas besoin d'éditer son premier message pour ajouter [Résolu]. Chuck Norris est toujours [Résolu], quoi qu'il arrive.

Hors ligne

#2 Le 29/10/2016, à 16:34

dudumomo

Re : Apache2 - Configuration rewriterule + proxypass

Salut,
Je suis loin d'etre un expert, mais j'aurai essaye un truc comme ca:

<VirtualHost *:8090>
DocumentRoot var/www/html/

        ProxyPass /kibana http://localhost:5601/
        ProxyPassReverse /kibana http://localhost:5601/

Sans faire une partie <Location ^/kibana>
Apres je sais pas trop si tu as d'autres services, site, etc..


Idipops, le réseau social des prestataires de services !
Tutorial and news on how to host your own server: http://freedif.org
Aidez la recherche avec BOINC et rejoignez la Mini-Team Libristes: http://www.boinc-af.org | http://libristes.boinc-af.net

Hors ligne