1. Output of caddy version
:
Version 2.5.2
2. How I run Caddy:
Under docker and listening on :80 and :443
a. System environment:
Docker on debian
b. Command:
docker restart caddy
c. Service/unit/compose file:
version: '3.9'
services:
caddy:
image: 'caddy:latest'
container_name: 'caddy'
restart: always
ports:
- '80:80'
- '443:443'
volumes:
- './Caddyfile:/etc/caddy/Caddyfile'
- './caddy_config:/config'
- './caddy_data:/data'
networks:
- webgateway
networks:
webgateway:
external: true
d. My complete Caddy config:
glpi-test.example.fr {
file_server
reverse_proxy glpi
rewrite /plugins/fusioninventory/* /front/inventory.php
encode gzip
tls internal
}
3. The problem I’m having:
The problem I’m having is that I have updated GLPI version to the latest but a lot devices (PDA) are pointing on the older link: http://glpi-test.exampl.fr/plugins/fusioninventory/. Now, I’m able to rewrite this url if this is in https but I can’t redirect the http…
4. Error messages and/or full log output:
I don’t have any error. It just doesn’t work.
Paste logs/commands/output here.
USE THE PREVIEW PANE TO MAKE SURE IT LOOKS NICELY FORMATTED.
5. What I already tried:
I tried something like:
https://glpi-test.example.fr {
file_server
reverse_proxy glpi
encode gzip
tls internal
}
http://glpi-test.example.fr {
reverse_proxy glpi
rewrite /plugins/fusioninventory/* /front/inventory.php
}
Which works but it also enable http access for the site.
Sorry, if I’m not clear, I still have to learn a lot of things.
Thank you for your help !
edit:
BTW, I’m using Caddy only for reverse proxy.
I did this:
https://glpi-test.example.fr {
reverse_proxy glpi
rewrite /plugins/fusioninventory/ /front/inventory.php
encode gzip
tls internal
}
http://glpi-test.exampl.fr/plugins/fusioninventory/ {
reverse_proxy glpi
rewrite /plugins/fusioninventory/ /front/inventory.php
}
And now it works in http only on specific url but i don’t know if this is “clean”. Also, how can I get a valid certificate for https ?