mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Create allow-index.php
This commit is contained in:
parent
54908c53d6
commit
621a94e858
1 changed files with 9 additions and 0 deletions
9
web/inc/allow-index.php
Normal file
9
web/inc/allow-index.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
// Custom script that will be included in custom Vesta installations to allow normal index.html if Vesta was proxied via default nginx
|
||||
|
||||
if (file_exists("/usr/local/vesta/web/inc/switch_to_vesta_port") && isset($_SERVER['HTTP_X_REAL_IP']) && $_SERVER['REQUEST_URI']=="/") {
|
||||
$hostname=trim(shell_exec("hostname"));
|
||||
$user=trim(shell_exec("sudo /usr/local/vesta/bin/v-search-domain-owner ".$hostname));
|
||||
if (file_exists("/home/$user/web/$hostname/public_html/index.html")) {echo file_get_contents("/home/$user/web/$hostname/public_html/index.html"); exit;}
|
||||
if (file_exists("/home/$user/web/$hostname/public_html/index.php")) {include("/home/$user/web/$hostname/public_html/index.php"); exit;}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue