Ce que je veux accomplir est de rediriger tout le trafic de http à https. Fondamentalement, j'ai une instance équilibrée, avec http et https fonctionnant. (Le https fonctionne bien, le certificat a été installé), et j'ai créé un répertoire .ebextensions dans mon application .war avec un fichier de configuration à l'intérieur comme suit.Rediriger vers Https en utilisant Elastic Beanstalk ELB
files:
/etc/httpd/conf.d/vhosts.conf:
content: |
<VirtualHost *:80>
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^/(.*)$ https://www.mydomain.com/$1 [R=301,L]
</VirtualHost>
group: root
mode: "000644"
owner: root
services:
sysvinit:
httpd:
enabled: true
ensureRunning: true
files:
- /etc/httpd/conf.d/vhosts.conf
Les journaux ...
2014-05-16 01:27:48,253 [DEBUG] /etc/httpd/conf.d/vhosts.conf already exists
2014-05-16 01:27:48,254 [DEBUG] Moving /etc/httpd/conf.d/vhosts.conf.bak to /etc/httpd/conf.d/vhosts.conf.bak2
2014-05-16 01:27:48,254 [DEBUG] Moving /etc/httpd/conf.d/vhosts.conf to /etc/httpd/conf.d/vhosts.conf.bak
2014-05-16 01:27:48,254 [DEBUG] Writing content to /etc/httpd/conf.d/vhosts.conf
2014-05-16 01:27:48,254 [DEBUG] Setting mode for /etc/httpd/conf.d/vhosts.conf to 000644
2014-05-16 01:27:48,254 [DEBUG] Setting owner 0 and group 0 for /etc/httpd/conf.d/vhosts.conf
2014-05-16 01:27:48,255 [DEBUG] Moving /etc/httpd/conf.d/vhosts.conf.bak2 to /etc/httpd/conf.d/vhosts.conf.bak
2014-05-16 01:27:48,255 [DEBUG] No commands specified
2014-05-16 01:27:48,255 [DEBUG] Using service modifier: /sbin/chkconfig
2014-05-16 01:27:48,255 [DEBUG] Setting service httpd to enabled
2014-05-16 01:27:48,372 [INFO] enabled service httpd
2014-05-16 01:27:48,372 [DEBUG] Using service runner: /sbin/service
2014-05-16 01:27:48,469 [DEBUG] No need to modify running state of service httpd
2014-05-16 01:27:48,481 [INFO] Running configSet Hook-PreAppDeploy
Vérification des journaux que je vois que le script est en cours d'exécution, et les modifications appliquées, mais je ne vois pas le service en cours de redémarrage. Cela pourrait-il être la raison de mon problème? Ou ai-je une autre erreur dans mon fichier de script?
Merci beaucoup pour votre aide.