Add nginx Configuration

Script Update.
This commit is contained in:
Phantom
2018-03-15 17:05:48 +03:00
parent 0d7e5c4dd8
commit ea463ff5ee
2 changed files with 57 additions and 2 deletions

View File

@@ -0,0 +1,51 @@
#
# Nginx Configuration to support the starting load of the Cisco phones via HTTP
#
# "Php-fpm" installation and configuration is required.
#
#
#
server {
listen 6970;
server_name tftp.servername.org;
#root /tftpboot;
root /tftpboot;
# Normal Logging
#access_log /var/log/nginx/tftp.access.log;
#error_log /var/log/nginx/tftp.error.log;
# Debug Rewrite Rules
rewrite_log on;
access_log /var/log/nginx/tftp.access.log;
error_log /var/log/nginx/tftp.error.log notice;
index index.php;
location / {
#rewrite ^([^.]*[^/])$ $1/ permanent;
#try_files $uri $uri/ /index.php?id=$query_string;
rewrite ^/(.*)$ /index.php?id=$1 last;
}
location ~ \.php$ {
proxy_read_timeout 61;
fastcgi_read_timeout 61;
try_files $uri $uri/ =404;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Deny access to .htaccess
location ~ /\.ht {
deny all;
}
error_page 404 /;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@@ -37,8 +37,12 @@ if (empty($path['languages'])) {$path['languages'] = $path['tftp']. '/locales/la
if (empty($path['deflanguages'])) {$path['deflanguages'] = $path['languages']. '/English_United_States';}
$locale_list = array('-dictionary.', 'dictionary-ext.', '-dictionary.utf-8.', '-kate.xml', '-font.xml', '-font.dat','-tones.xml',
'be-sccp.jar', 'tc-sccp.jar', 'td-sccp.jar', 'ipc-sccp.jar', 'mk-sccp.jar', '_locale.loads', 'i-button-help.xml');
print_r($path);
if ($print_debug == 'on') {
print_r('<br> Init Pach: <br>');
print_r($path);
print_r('<br> Request: <br>');
print_r($request);
}
$req_file_full_path = '' ;
if (!empty($req_file)) {