使用 Docker 运行 laravel 应用程序,我从 http 而不是 https 获取内容加载

使用 Docker 运行 laravel 应用程序,我从 http 而不是 https 获取内容加载

我正在将我的 laravel 应用程序 docker 化,当它加载时,我收到一条错误消息,提示无法提供混合内容。我查看了 html 页面的源代码,尽管我使用的是 https,但它确实从 http 方案加载了 app.js 文件。当我在自己的 nginx 服务器上安装相同的 laravel 应用程序并重定向到 https 时,app.js 会使用 https 呈现。所以这与 laravel 无关。如何让 Docker 中的 nginx conf 将内容提供给 https?我当前的 .conf 文件是这样的:

server {
    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/html/public;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}


相关内容