I believe your best option is not try to do all with the same website (virtualhost). Create 2 separate websites, and use the IP binding command to link one website to the local:
<VirtualHost 192.168.1.10:80>
Then create another virtualhost for the public site:
<VirtualHost 205.11.22.33:80>
Hope this helps, if not please let me know.
I did try that, using the FQDN and the internal LAN address. It broke stuff. I think, however, you're talking about multiple daemons, which I can't do really due to lack of multiple external IP addresses.
I did try multiple virtualhosts inside the 000-sites-enabled.conf:
In this case, it's not possible due to serving on *:443 and *:80, which overrides any FQDN:PORT virtualhost instance later on in the config. Ordinarily I'd do it on :80 and not open that to the world, but the way the system is set up here, some things need to see an HTTP address to know they're authorized to do their work, as well as receiving codes every now and then. I know that's not the best way to do it these days, but when you work with legacy shit that's the way it is. I don't care that you might see "FQDN/docuroot/enterprise/transporterroom/button/code/YJ8MOP998S1
The original thing I tried worked, that of a "require ip 1.2.3.4" directive, but if you tried to access that directory outside of the LAN it gave Apache's Forbidden screen, which I don't want. Since you can't serve anything, even an error page, when you're forbidden, it didn't do what I needed.
What I really need to dig into is to see if there's an IF methodology. I know there's some basic logic Apache can do, but I haven't reached that stage yet.
Maybe modrewrite could help you? Check this link:
https://httpd.apache.org/docs/trunk/rewrite/access.html
Specially the blocking of bots part, hope this helps!
That's not really what I need, it's kind of a different use case. However, I decided to grab the "Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request." portion of the error and found this:
After enabling the rewrite mod and adding the .htaccess as described, I can now hit the desired site internally (using the FQDN since the router hairpins) but it gets rejected with an error page outside the network. What a pain in the ass.
(post is archived)