mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix missing path info on nginx.
Update nginx documentation to set the PATH_INFO variable. Avoid hacks in index.php if it PATH_INFO is already set for both nginx and apache.
This commit is contained in:
@@ -186,6 +186,7 @@ server {
|
|||||||
try_files $uri $uri/ @librenms;
|
try_files $uri $uri/ @librenms;
|
||||||
}
|
}
|
||||||
location ~ \.php {
|
location ~ \.php {
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
include fastcgi.conf;
|
include fastcgi.conf;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
|
|||||||
@@ -12,11 +12,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if( strstr($_SERVER['SERVER_SOFTWARE'],"nginx") ) {
|
if (empty($_SERVER['PATH_INFO'])) {
|
||||||
|
if( strstr($_SERVER['SERVER_SOFTWARE'],"nginx") ) {
|
||||||
$_SERVER['PATH_INFO'] = str_replace($_SERVER['PATH_TRANSLATED'].$_SERVER['PHP_SELF'],"",$_SERVER['ORIG_SCRIPT_FILENAME']);
|
$_SERVER['PATH_INFO'] = str_replace($_SERVER['PATH_TRANSLATED'].$_SERVER['PHP_SELF'],"",$_SERVER['ORIG_SCRIPT_FILENAME']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$_SERVER['PATH_INFO'] = !empty($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : (!empty($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : '');
|
$_SERVER['PATH_INFO'] = !empty($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function logErrors($errno, $errstr, $errfile, $errline) {
|
function logErrors($errno, $errstr, $errfile, $errline) {
|
||||||
|
|||||||
Reference in New Issue
Block a user