[GH-ISSUE #19] nginx + ViMbAdmin #16

Closed
opened 2026-02-26 09:35:10 +03:00 by kerem · 2 comments
Owner

Originally created by @f8bar on GitHub (Jun 5, 2012).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/19

Originally assigned to: @barryo on GitHub.

It's actually not a bug but if you're using NGINX with the standard configuration and HTTPS is not active on your vhost
Nginx fills the $_SERVER['HTTPS'] with an empty String thanks to the preconfigured fastcgi_params.

The result is that the genUrl will allways start with https://...:
$vView->pagebase = 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://'

in library/ViMbAdmin/Controller/Action.php on line: 342.

A much more accurate way to check if HTTPS is active would be:
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
or
if($_SERVER['SERVER_PORT'] == '443')

Originally created by @f8bar on GitHub (Jun 5, 2012). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/19 Originally assigned to: @barryo on GitHub. It's actually not a bug but if you're using NGINX with the standard configuration and HTTPS is not active on your vhost Nginx fills the $_SERVER['HTTPS'] with an empty String thanks to the preconfigured fastcgi_params. The result is that the genUrl will allways start with https://...: $vView->pagebase = 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' in library/ViMbAdmin/Controller/Action.php on line: 342. A much more accurate way to check if HTTPS is active would be: if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { or if($_SERVER['SERVER_PORT'] == '443')
kerem closed this issue 2026-02-26 09:35:11 +03:00
Author
Owner

@barryo commented on GitHub (Jun 14, 2012):

Thanks @f8bar - this is now in the dev branch and will be included in the next release.

<!-- gh-comment-id:6321430 --> @barryo commented on GitHub (Jun 14, 2012): Thanks @f8bar - this is now in the dev branch and will be included in the next release.
Author
Owner

@f8bar commented on GitHub (Sep 5, 2012):

Your commit throw a syntax error...
Please use this line for 343:
. (((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) && $_SERVER['HTTPS'] !== 'off' ) || ( isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443 ) ) ? 's' : ''

<!-- gh-comment-id:8293430 --> @f8bar commented on GitHub (Sep 5, 2012): Your commit throw a syntax error... Please use this line for 343: . (((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) && $_SERVER['HTTPS'] !== 'off' ) || ( isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443 ) ) ? 's' : ''
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#16
No description provided.