Community @ The Turning Gate

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.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2018-09-12 11:13:22

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Changes to Nginx configuration?

I'm using Nginx, rather than Apache. You have a recommended Nginx configuration in your documentation Appendix that I have been using very successfully, and my site is working great. Since BL2 seems to rely very heavily on the .htaccess rewrite rules to function correctly, is there a recommended set of changes to the Nginx configuration to reflect these required rewrite rules?

Offline

#2 2018-09-12 11:25:16

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Not so far.  I would need to find the time to deploy on Nginx to see what changes need to be made to the configuration.
While Backlight 2 makes heavy use of .htaccess to use clean URLs, in many ways Backlight 2 depends very little on .htaccess.  99% of it should run without any support for rewriting URLs at all.  In that case, dynamic URLs all take the form of ?m=application&c=controller&action=something&p1=123.

As with Nginx, I will need to take time to test further with rewrite disabled completely to see how well this works.  I think that the LR Publisher will need to be updated to handle an API URL like http://yoursite.com/backlight/?m=publisher

Offline

#3 2018-09-14 06:21:14

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Thank you for the information.

I'll await an update to the publisher and adjustments to Nginx configuration information, so that I can upgrade to BL2 as it looks to be excellent.

Last edited by gkar47 (2018-09-14 06:21:50)

Offline

#4 2018-10-15 08:21:05

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Is there any update on using/configuring Backlight 2 with Nginx?

Offline

#5 2018-10-15 09:02:35

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Only that I've had a cursory look into it and discovered there are a few changes that will need to be made.  As we do not officially support Nginx, our priority is on fixing other issues first.

Offline

#6 2018-10-20 02:48:21

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Ok. I'll await when you get caught up and can look into Nginx.

Thank you.

Offline

#7 2018-12-20 05:43:22

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Hi Ben,

Just touching base to see if there has been any progress in the adjustments needed to install Backlight2 on Nginx? I would really like to upgrade to Backlight2 and make use of it's wonderful new capabilities.

Offline

#8 2018-12-20 06:17:36

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

I'd started to look into this, but came across more dependencies on clean URLs than I expected.  Thanks for the bump.  I'll try to prioritise it.

Offline

#9 2019-01-28 06:58:17

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Hi Ben,

Just checking if you have had any time to look at this.

Offline

#10 2019-04-20 13:34:01

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Hi Ben,

Have you had a chance to have a look at the Nginx adjustments needed?

Offline

#11 2019-04-23 20:51:10

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Sorry, I keep getting dragged away by other tasks. I will revisit this, again.

Offline

#12 2019-04-25 04:09:50

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Thank you.

I would really like to upgrade to Backlight 2, since I'm seeing and hearing so much good about it.

Offline

#13 2019-04-25 09:03:41

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

I've almost completed getting the main Backlight functionality working without needing URL rewriting. That is, galleries, publishing, etc.  Which other plugins do you use?  Cart, Client Response, Galleria, Theater, Wordpress?

Offline

#14 2019-05-01 07:42:58

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Thank you.

I use Galleria and Theatre plugins.

Offline

#15 2019-06-27 02:53:35

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Just checking if there is any progress with the Nginx install for Backlight 2?

Offline

#16 2019-06-27 06:51:26

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

There has been progress and we have a version that does not need Apache URL rewriting in our testing stream.
It would be helpful if you could use this version and provide any feedback on issues.

To use it:

* After uploading the extracted files from the installer, copy or rename the file backlight/env.php.skel to backlight/env.php
* Edit the file and change the value for STREAM from "release" to "testing"
* Continue setting up Backlight as usual

You should see a red "testing" icon in the footer of the Backlight admin page.

The only other thing to change is the format of the API URL set in Lightroom's Publisher. This needs to be in the format of

http://yoursite.com/backlight/?m=publisher

That format likely won't change, because the Publisher can't determine whether the server is using Backlight 1 or 2 and the new format won't work for Backlight 1.

Please give it a try and let me know how it goes. There are no known issues other than in handling search forms between Wordpress and Backlight. Once the changes are ready to go into the release stream, changing from testing is a matter of undoing the change to env.php and clicking 'reinstall all' in the Backlight Modules page.

Offline

#17 2019-07-08 08:53:53

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

I've got it installed and was going through the installer. It succeeded. But, when I click the "Continue to Backlight" button I get the following error:

preg_match() expects at least 2 parameters, 1 given|#0 [internal function]: ErrorHandler::handleError(2, 'preg_match() ex...', '/www/billelliot...', 220, Array) #1 /www/billelliot.ca/html/backlight/modules/module-framework/helpers/URLHelper.php(220): preg_match('/8443/www.bille...') #2 /www/billelliot.ca/html/backlight/modules/module-framework/helpers/URLHelper.php(193): URLHelper::pageURL('/backlight/') #3 /www/billelliot.ca/html/backlight/modules/module-framework/helpers/URLHelper.php(199): URLHelper::absoluteCurrentPageURL() #4 /www/billelliot.ca/html/backlight/modules/module-framework/models/Dispatchable.php(267): URLHelper::currentPageURL() #5 /www/billelliot.ca/html/backlight/modules/module-framework/models/Dispatchable.php(92): Dispatchable->processAuthentication() #6 /www/billelliot.ca/html/backlight/modules/module-framework/Framework.php(50): Dispatchable->init() #7 /www/billelliot.ca/html/backlight/index.php(32): Framework->route() #8 {main}|URL: /backlight/index.php

So I can't get to the Admin screen to change the format of the API URL.

What should I do?

Offline

#18 2019-07-08 10:38:09

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

gkar47 wrote:

What should I do?

Thanks for testing it.  Wait for me to fix it.  I'll look into this tonight.

Offline

#19 2019-07-08 10:39:12

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Further to the above, if possible can you provide me with FTP access.  This is in case I'm not able to reproduce it on my end.

Offline

#20 2019-07-08 10:40:23

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Further again, try visiting /backlight/ on your server.  It may just be that the 'continue' link doesn't work.

Offline

#21 2019-07-08 12:13:52

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

The link from'continue' is correct and works in that it takes me to /backlight/. It just produces the error. I tried it directly and get the same result.

I don't currently have external ftp access. But, if you need it I can get it setup.

Also, if you need any log outputs, I can provide you with those.

Offline

#22 2019-07-08 12:34:03

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

I can see the problem.  Can you try doing the following and let me know if it solves it:

Edit the file on your server backlight/modules/module-framework/helpers/URLHelper.php and change line 220 from this:

if (!isset($_SERVER['HTTP_HOST']) || preg_match('/'.$_SERVER['SERVER_PORT'].'/'.$_SERVER['HTTP_HOST'])) {

to this:

if (!isset($_SERVER['HTTP_HOST']) || preg_match('/'.$_SERVER['SERVER_PORT'].'/', $_SERVER['HTTP_HOST'])) {

The only change is replacing the last period with a comma and space.

Offline

#23 2019-07-08 12:48:31

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Changes to Nginx configuration?

Something important for you to note.

Without mod-rewrite support, you'll need to add lines into your Nginx config to prevent access to the data files and digital purchases, if you're using those with the cart.  To do that, see the Wiki documentation for Nginx, on Backlight 1:

http://backlight.theturninggate.net/doc … web_server

In particular, your server config should have these two entries:

# protect against direct downloads of data files
location /backlight/data/ {
    return 404;
}

# protect against direct downloads of digital purchases
rewrite ^(.*)/(.*)/photos-for-purchase/* / last;

Ignore further URL-related entries in that document for now.

Offline

#24 2019-07-09 04:41:08

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

I've made major progress. I can now get to the admin page and have been able to look around there. There was one other rewrite rule in my nginx config from Backlight 1. Is the following still needed:

rewrite ^(.*)/(.*)-single.php $1/single.php?id=$2 last;

Not all my modules are there. I'm missing the addons Galleria and Theatre.

Also, when I try to view an album I get the following error:

Warning: require_once(./../../../backlight/framework/Framework.php): failed to open stream: No such file or directory in /www/billelliot.ca/html/albums/Puerto-Vallarta-Mexico-Trip/1-Puerto-Vallarta-Malecon/lib.php on line 48

Fatal error: require_once(): Failed opening required './../../../backlight/framework/Framework.php' (include_path='.:/usr/lib64/php/:/usr/share/pear/:/usr/share/php/') in /www/billelliot.ca/html/albums/Puerto-Vallarta-Mexico-Trip/1-Puerto-Vallarta-Malecon/lib.php on line 48

I've looked and the lib.php file is there.

Offline

#25 2019-07-09 05:57:10

gkar47
Member
From: Calgary Alberta
Registered: 2018-07-09
Posts: 36

Re: Changes to Nginx configuration?

Oops. Forget the problem with viewing my albums. I forgot to click in admin on the Special Links / Update Album Files. I did that and can now view my albums.

Offline

Board footer

Powered by FluxBB