title: Laravel 5 and Cloudflare SSL
body: <p>Well, today the first time I decided to use <code>ssl</code> on my web project. Firstly, I configured my domain in cloudflare.com. Then I turned on page rules in cloudflare, to automatic redirect the website to https.</p>
  
  <pre><code>http://*example.com/*
  </code></pre>
  
  <p>To make sure that it works, i added simple <code>index.php</code> to the public_html and it worked. I mean, when I entered to the web site, <code>https</code> was active and the site displayed me the famous word: "Hello World"</p>
  
  <p>After that I uploaded my Laravel project to the web server and configured virtual host. I use nginx server.</p>
  
  <pre><code>server {
          listen 80;
  
          root /home/user/www/example.com/public_html/public;
          index index.php index.html index.htm;
  
          server_name example.com
  
          location / {
                  try_files $uri $uri/ =404;
          }
  
          error_page 404 /404.html;
          error_page 500 502 503 504 /50x.html;
  
          location = /50x.html {
                  root /usr/share/nginx/html;
          }
  
          location ~ \.php$ {
                  try_files $uri =404;
                  fastcgi_split_path_info ^(.+\.php)(/.+)$;
                  fastcgi_pass unix:/var/run/php5-fpm.sock;
                  fastcgi_index index.php;
                  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_nam$
                  include fastcgi_params;
          }
  }
  </code></pre>
  
  <p>Well, when I enter to the website with <code>https</code>, Laravel routes don't work. Also, my css and js files weren't read by server.</p>
  
  <p>Then I turned off page rules from cloudflare, site worked good with <code>http</code>.</p>
  
  <p>I tried to configure the server with <code>listen 443</code>, used <code>ssl on</code> command, but wasn't any result.</p>
  
  <p>Also, I found this link about cloudflare with laravel 5. But not sure, this is that, what I want.</p>
  
  <p><a href="https://github.com/BootstrapCMS/CloudFlare" rel="nofollow">Laravel Cloudflare</a></p>
  
  <p>Any help, would appreciated.</p>