带有nginx Https的Laravel显示不安全

时间:2017-07-19 07:41:39

标签: nginx https

我使用nginx https配置了laravel 5.4。页面正在加载https。我在nginx配置文件中配置了ssl证书和ssl密钥。但它仍然显示不安全。

这是我的nginx配置文件     服务器

{
         listen 80;
         #listen [::]:80 default_server ipv6only=on;
         listen 443 ssl;

         root /usr/share/nginx/html/project;
         index index.php index.html index.htm;

         # Make site accessible from http://localhost/
           server_name project.dev;
          ssl_certificate /etc/nginx/ssl/nginx.crt;
          ssl_certificate_key /etc/nginx/ssl/nginx.key;

          access_log /var/log/nginx/access.log;
          error_log  /var/log/nginx/error.log;

          location / {
                # proxy_pass $uri:8181;
                #proxy_pass http://localhost:8181;
                try_files $uri $uri/ /index.php?$query_string;
          }

         location ~ \.php$ {
                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
                 fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                 #fastcgi_pass unix:/var/run/php5-fpm.sock;
                 fastcgi_index index.php;
                 fastcgi_read_timeout 180;
                 include fastcgi_params;
         }

        location ~ /\.ht {
                deny all;
        }
    }

这是我的.htaccess文件                         选项-MultiViews        

   RewriteEngine On

   # Redirect Trailing Slashes If Not A Folder...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)/$ /$1 [L,R=301]

   # Handle Front Controller...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^ index.php [L]

   # Handle Authorization Header
   RewriteCond %{HTTPS} !=on
   RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

0 个答案:

没有答案