DeltaHF
Well-known member
I'm going to convert my vBulletin forum to XenForo, and I want to close off the /forum/ subdirectory of my site during the process and return a custom 503 error page. Of course, I still need to be able to access the subdirectory from my IP address while this is going on. I'm using Nginx and PHP-FPM.
Here's my first attempt at a relevant location block, assuming my IP address is 0.0.0.0. It blocks public requests to static files in the /forum/ directory, but PHP files can still be accessed by anyone.
If I remove the "include" which loads in my php.conf, then I can't execute PHP files in the directory myself, which is obviously a requirement. Any ideas how I can get this working?
Here's my first attempt at a relevant location block, assuming my IP address is 0.0.0.0. It blocks public requests to static files in the /forum/ directory, but PHP files can still be accessed by anyone.
Code:
location ^~ /forum/
{
if ($remote_addr != "0.0.0.0")
{
return 503;
}
include /usr/local/nginx/conf/php.conf;
}
If I remove the "include" which loads in my php.conf, then I can't execute PHP files in the directory myself, which is obviously a requirement. Any ideas how I can get this working?