Sim
Well-known member
On my old vBulletin based site, I had a maintenance mode I could enable which redirected all traffic to a static HTML error page temporarily with a 503 return code - so I could play around with the forum files without needing XenForo to be operational.
For some reason I'm having a lot of difficulty getting the same code to work with XenForo - which I suspect is something to do with the differences in how the PHP files are loaded between my two server configs.
Any nginx gurus out there have any suggestions which they know work?
This is what worked with my vB site - I just uncommented the first three lines and restarted nginx to put it into maintenance mode and commented them out to make the site live again.
The main difference between my server blocks for vBulletin and XenForo is that my XF version includes the try_files directive for pretty URLs.
Could it be this which is stopping my maintenance mode from working?
For some reason I'm having a lot of difficulty getting the same code to work with XenForo - which I suspect is something to do with the differences in how the PHP files are loaded between my two server configs.
Any nginx gurus out there have any suggestions which they know work?
This is what worked with my vB site - I just uncommented the first three lines and restarted nginx to put it into maintenance mode and commented them out to make the site live again.
Code:
#if ($remote_addr != "my.ip.address") {
# return 503;
#}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /error503.html break;
}
The main difference between my server blocks for vBulletin and XenForo is that my XF version includes the try_files directive for pretty URLs.
Code:
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
Could it be this which is stopping my maintenance mode from working?