-
if i change the file inc/header.inch.php
this variable:
define('BX_DOL_URL_ROOT', 'https://example.com/');
with this variable
define('BX_DOL_URL_ROOT', ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') ? 'https' : 'http') . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'https://example.com/') . '/');
i will get this invalid link in logs and the video transcoding Failed:
May 26 14:07:01 [0] CRON [bx_videos_video_poster_preview] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/cyhipts9iduxcqyszqj3ehyt924rzqnt.mp4) failed May 26 14:07:01 [0] CRON [bx_videos_video_mp4] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/cyhipts9iduxcqyszqj3ehyt924rzqnt.mp4) failed May 26 14:07:01 [0] CRON [bx_videos_video_poster_cover] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/cyhipts9iduxcqyszqj3ehyt924rzqnt.mp4) failed May 26 14:07:01 [0] CRON [bx_videos_video_poster_gallery] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/cyhipts9iduxcqyszqj3ehyt924rzqnt.mp4) failed May 26 14:14:02 [0] CRON [bx_videos_video_poster_preview] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/hyfhstxd65w7wq4jbjegmbzdpmlzdvmb.mp4) failed May 26 14:14:02 [0] CRON [bx_videos_video_poster_gallery] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/hyfhstxd65w7wq4jbjegmbzdpmlzdvmb.mp4) failed May 26 14:14:02 [0] CRON [bx_videos_video_mp4] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/hyfhstxd65w7wq4jbjegmbzdpmlzdvmb.mp4) failed May 26 14:14:02 [0] CRON [bx_videos_video_poster_cover] ERROR: storeFileLocally_Storage failed, getting file from URL(http://https://www.exemple.com//s/bx_videos_videos/hyfhstxd65w7wq4jbjegmbzdpmlzdvmb.mp4) failed
I mention that I did the installation using the variable
UNA_AUTO_HOSTNAME=1
in .env file for the instalation proces. Returning to the original variable in inc/header.inc.php
define('BX_DOL_URL_ROOT', 'https://example.com/');
video transcoding works correctly and videos are processed correctly
-
Hello @ORV !
It seems this construction
((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') ? 'https' : 'http') . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'https://example.com/') . '/'
gives the less '/' symbol at the end of the URL. It looks so by your provided log.
-
To define the
BX_DOL_URL_ROOT
constant correctly, make sure the URL construction is complete and all parentheses are closed. In your current versions, there is a syntax error in the second variant due to a missing closing parenthesis.Correct Version:
define('BX_DOL_URL_ROOT', ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') || (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') ? 'https' : 'http') . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'www.exemple.com/') . '/');
Checking the scheme:
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
: If the connection is secure (HTTPS).(!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
: If the forwarded protocol is HTTPS.(!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on')
: If SSL is on.
Constructing the scheme:
- If any of the above conditions are true, the scheme is
https
, otherwisehttp
.
Constructing the host:
isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'www.exemple.com'
: IfHTTP_HOST
is set, use it, otherwise usewww.exemple.com
as the default value.
Adding a trailing slash:
.
/ '`' adds a trailing slash to the URL to ensure correct formatting.
Your fragment has a syntax error (missing closing parenthesis at the end) and should be corrected. However, it seems that you were right, I omitted to add this character "/" to the end of my domain name i wil check it out again. Big thank you.
-