Issue with Paths and Reverse Proxy with DNS

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
promptworks
Registered User
Posts: 2
Joined: Tue Apr 23, 2024 5:13 am

Issue with Paths and Reverse Proxy with DNS

Post by promptworks »

Hello everyone,

I just set up a fresh install of PHPBB 3.3, latest copy from the website.

Everything went smoothly during the install. No issues with dependencies, and super awesome how easy it was to set up.

The forum works flawlessly when accessed from within my Lan with the IP address. The issue comes with my reverse proxy setup and the way phpBB is handling paths.

I am using a reverse proxy with Apache2 to point https://www.promptworks.us/forums to my forums server on 192.168.0.55 .

The reverse proxy works, you can see my forum at the above location. Only issue is no styles - the reason is because phpBB is attempting to load styles from https://www.promptworks.us/styles, and assets from https://www.promptworks.us/assets

Image

Any recommendations on how to proceed? I have searched for PHPBB issues with this but I haven't found any forum topics about this specific issue (surprisingly) - I guess this isn't a common setup.

I looked at the path_helper scripts within the php, and that file is complex and seems to address a lot of different pathing scenarios, not something I want to go tear up. I've tried manually overriding the paths in certain places with no luck, and restored the original path_helper.php to what it comes with by default.

Another option would be to use my reverse proxy to allow my forums server to control promptworks.us/styles and promptworks.us/assets among other directories which are used by phpBB - but I don't necessarily want to do that, it seems to me cleaner and more intuitive that promptworks.us/forums/styles and promptworks.us/forums/assets would be used to load these files.

I have gone into the ACP and set the "script root" directory to /forums and tried the override flag. These do not fix the issue however.

I was hoping someone more familiar with how pathing works in phpBB can help me navigate how I might modify the pathing code to get it working with this setup. Or perhaps I am missing something else.

Thanks in advance for any help
promptworks
Registered User
Posts: 2
Joined: Tue Apr 23, 2024 5:13 am

Re: Issue with Paths and Reverse Proxy with DNS

Post by promptworks »

UPDATE:
I have blown away my phpBB server.

After digging through the pathing code, I haven't been able to find a solution that doesn't involve several changes to the source code which I'm not prepared to do - I want to be able to easily update this later.

I think the core of my issue is that I'm trying to install it at domain.com/forum

Mainly because I don't want to pay extra for an SSL certificate that handles more subdomains than www.promptworks.us.

At some point when I get a chance, I will try installing this on a subdomain and see if I get better results.
HB
Registered User
Posts: 214
Joined: Mon May 16, 2005 9:30 pm

Re: Issue with Paths and Reverse Proxy with DNS

Post by HB »

I don't know if this would have fixed your problem, but it's worth noting the startup code in every phpBB file:

Code: Select all

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
I think you could define PHPBB_ROOT_PATH in your config.php file and the styles/assets URLs would be resolved as you expected, something like this:

Code: Select all

@define('PHPBB_ROOT_PATH', '/forum/');
That said, I haven't tried it.
promptworks wrote: Thu Apr 25, 2024 4:24 am Mainly because I don't want to pay extra for an SSL certificate that handles more subdomains than www.promptworks.us.
FWIW, you can get free SSL certificates from Let's Encrypt and Cloudflare, to name only two possibilities.
Dan Kehn

Return to “[3.3.x] Support Forum”