Server
Your own nginx rules
Each site has a file that LuckyBX does not overwrite:
/etc/nginx/luckybx/shop.example.com.custom.confIts lines go inside the site settings. After editing, check them and apply:
nginx -t && systemctl reload nginxIf the file has an error, the first command shows it, and the site keeps working the old way.
Send an old page to a new one#
location = /old-page/ { return 301 /new-page/; }Block a file#
location = /secret.html { deny all; }Rebuild the settings#
If the nginx settings of some site were broken by accident, they can be built again. Your custom.conf files stay:
luckybx site rebuildWhat not to do#
Do not write rules for whole folders that contain PHP files. Such a rule can give a visitor the program text instead of the page.
The admin area can be restricted by address without editing files, see Security.
Rules from .htaccess are read by Apache, which can be turned on for a site: Apache.