Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
I'm using nginx and running as a non-root ID for security reasons. Therefore the site is setup to use port 8080 and 8443 with the firewall port forwarding 80 to 8080 and 443 to 8443.
I've just installed all the latest software I purchased from you, the backlight+pages, galleria, and theatre.
My site is https://www.billelliot.ca with guest password Amiga-2500
The site enforces https access and is using mostly the recommended setup from your documentation on setting up nginx.
When I go to the only gallery I have published it tries to switch the url from https://www.billelliot.ca to https://www.billelliot.ca:8443. The 8443 port is not in the URL I have defined in the admin settings. This required that I open port 8443 to the outside and map it to 8443 on the inside to get this far.
Another problem then shows up in the gallery, which might be related to the 8443 port issue. When I click on any picture I get an error message pop up on the display page of "The requested content cannot be loaded. Please try again later.". I have verified that the image that it is trying to display does exist with the same security as the thumbnail that is displayed in the gallery.
I have tried this in several browsers with similar results. Chrome Version 67.0.3396.99 (Official Build) (64-bit) with developer mode turned on shows a number of violations in the console.
What can I do to get ride of the :8443 port override in the URL, and is this causing the error above?
Offline
Backlight attempts to construct URLs in a couple of places, using the PHP variable $_SERVER['SERVER_PORT'] and adding in the port number to the URL of not set to 80 or 443. It looks like this is picking up the port from the web server (as I'd expect it to) and not the proxy server.
A workaround to avoid this would be to disable the two lines of code that add the port numbers to the URL. These are line 400 in backlight/publisher/application/helpers/PublisherHelper.php and line 199 in backlight/framework/helpers/URLHelper.php. They can be disabled by prepending // to the start, e.g.
//$host .= ':' . $_SERVER["SERVER_PORT"];
Can you provide me with a Backlight admin login via email so that I can see what the URL/port settings look like in PHP Info? This may help work out a longer term solution.
Offline
I have commented out the 2 lines above. But, now I get the following error message on the page and nothing else:
currentPageMismatch: https://www.billelliot.ca:8443/ !=. https://www.billelliot.ca/
I've sent the password. I've also uncommented the lines so you can see the site.
Last edited by gkar47 (2018-07-15 03:04:35)
Offline
PHP Info gives me "phpinfo() has been disabled for security reasons"
In addition to the disabling in my earlier comment, also disable lines 181-185 in URLHelper, like this:
/*$cpuOld = URLHelper::currentPageURLOld();
if ($cpu != $cpuOld) {
die('currentPageMismatch: '.$cpuOld.' !=. '.$cpu);
}*/
Offline
Thank you. That did the trick for the port number addition to the URL.
It still has the issue with the error message on clicking on a picture.
I've temporarily enabled phpinfo() while you're trouble shooting.
Offline
It looks like HTTP_HOST may be useful in determining whether the incoming port was specified in the browser URL or not. I'll keep this in mind for any future solution.
Here is an example URL that fails to load an image:
https://www.billelliot.ca/galleries/bikesineurope/photos/P1040051.jpg
Does that image exist at that location? Are you running any URL rewriting that could be tripping it up?
Offline
I haven't added any rewrite directives to the recommended base Nginx setup article. The only changes I made was to add https, a redirection of http requests to https, and add a root directive as follows:
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
root www/billelliot.ca/html;
expires max; log_not_found off;
}
The "/galleries/bikesineurope/photos/P1040051.jpg" exists directly under that root.
I do notice the following rewrite from your config. I'm not sure if this is causing any issues as I'm not too familiar with rewrite rules.
rewrite ^(.*)/(.*)/photos/* / last;
The image file is exactly there, the same as the thumbnail image that is displayed for the grid.
Last edited by gkar47 (2018-07-16 11:00:48)
Offline
That rewrite rule from our documentation looks to be incorrect. Can you try changing that from photos to photos-for-purchase?
Offline
Excellent!
That did the trick. Everything seems to be working fine now on display.
Now I can start configuring the site and experiment with some of the other display templates.
Thank you for your excellent help.
Offline
No worries. I’m glad to have been able to help. The proxy port issue is a discovery that will lead towards better code.
Offline
Pages: 1