enabling ssl in apache with cloudfare

时间:2018-02-03 08:47:46

标签: apache ssl

I have enabled

use HTTPS always in Cloudflare and that's working.

Now, coming to Apache, I am on AWS AMI and this is what httpd.conf looks like:

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
   ServerName *.aonesalons.com
   DocumentRoot  /var/www/dist/
   <Directory /var/www/dist/>
        # Don't rewrite files or directories
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
        # Rewrite everything else to index.html to allow html5 state links
        RewriteRule ^ index.html [L]
    </Directory>
</VirtualHost>


<VirtualHost *:443>
   ServerName *.aonesalons.com
   DocumentRoot  /var/www/dist/
   SSLEngine      on
   SSLCertificateFile        /home/ec2-user/aonesalons.com.pem
   SSLCertificateKeyFile     /home/ec2-user/aonesalons.com.key

   <Directory /var/www/dist/>
        # Don't rewrite files or directories
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]
        # Rewrite everything else to index.html to allow html5 state links
        RewriteRule ^ index.html [L]
    </Directory>
</VirtualHost>

It worked just fine on port 80, however with https, it shows default test page of apache server on AWS AMI.

You can try with demo.aonesalons.com. I am probably missing something very basic here. Can I get some help, please?

0 个答案:

没有答案