Bonjour à tous,
J'ai 2 sites web:
site n ° 1: https://private.mydomain.net/
site n ° 2: http://localhost:3000/ qui retourne
http://localhost:3000/lua/index.lua?bloc_instruction/
Le fait est que je veux faire un proxy du site n ° 1 vers le site n °2 sur un répertoire "site2" pour avoir:
https://private.mydomain.net/site2 -> https://private.mydomain.net/site2/l...oc_instruction
Pour cela, j'ai créé un fichier de configuration site2.conf dans /etc/apache2/conf-available comme ceci:
et voici le résultat quand j'entre dans le lien:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 ProxyRequests Off ProxyHTMLExtended On ProxyPass /site2/ http://127.0.0.1:3000/ <Location /site2/> ProxyPassReverse / SetOutputFilter proxy-html ProxyHTMLURLMap / /site2/ RequestHeader unset Accept-Encoding </Location>
https://private.mydomain.net/site2 devient
https://private.mydomain.net/lua/ind...oc_instruction
au lieu de
https://private.mydomain.net/site2/l...oc_instruction
Comment puis-je réparer cela ?
voici la config du site principal qui héberge un serveur nextcloud :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ServerName private.mydomain.net Include /etc/letsencrypt/options-ssl-apache.conf <Directory /var/www/html> AllowOverride All </Directory> <IfModule proxy_fcgi_module> # Enable http authorization headers <IfModule setenvif_module> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 </IfModule> <FilesMatch ".+\.ph(ar|p|tml)$"> SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost" </FilesMatch> <FilesMatch ".+\.phps$"> # Deny access to raw php sources by default # To re-enable it's recommended to enable access to the files # only in specific virtual host or directory Require all denied </FilesMatch> # Deny access to files without filename (e.g. '.php') <FilesMatch "^\.ph(ar|p|ps|tml)$"> Require all denied </FilesMatch> </IfModule>
Partager