Reverse Proxy & Log Format
- Published in Nginx
-
( ! ) Notice: Undefined property: Joomla\CMS\User\User::$profile in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category_item.php on line 49 Call Stack # Time Memory Function Location 1 0.0007 402904 {main}( ) .../index.php:0 2 0.0475 1320416 Joomla\CMS\Application\SiteApplication->execute( ) .../index.php:49 3 0.0475 1320416 Joomla\CMS\Application\SiteApplication->doExecute( ) .../CMSApplication.php:196 4 0.1849 2977376 Joomla\CMS\Application\SiteApplication->dispatch( ) .../SiteApplication.php:233 5 0.1854 3001720 Joomla\CMS\Component\ComponentHelper::renderComponent( ) .../SiteApplication.php:194 6 0.1861 3057048 Joomla\CMS\Component\ComponentHelper::executeComponent( ) .../ComponentHelper.php:377 7 0.1862 3074104 require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) .../ComponentHelper.php:402 8 0.1917 3140856 K2ControllerItemlist->execute( ) .../k2.php:64 9 0.1917 3140856 K2ControllerItemlist->display( ) .../BaseController.php:710 10 0.1950 3229944 K2ControllerItemlist->display( ) .../itemlist.php:49 11 0.1950 3229944 K2ControllerItemlist->display( ) .../controller.php:19 12 0.1961 3248840 Joomla\CMS\Cache\Controller\ViewController->get( ) .../BaseController.php:663 13 0.1990 3269576 K2ViewItemlist->display( ) .../ViewController.php:102 14 0.2479 3714016 K2ViewItemlist->display( ) .../view.html.php:1407 15 0.2479 3714016 K2ViewItemlist->loadTemplate( ) .../HtmlView.php:230 16 0.2499 3784136 include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category.php' ) .../HtmlView.php:701 17 0.2501 3784136 K2ViewItemlist->loadTemplate( ) .../category.php:94 18 0.2514 3864896 include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category_item.php' ) .../HtmlView.php:701
Written by alamise( ! ) Notice: Trying to get property 'gender' of non-object in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category_item.php on line 49 Call Stack # Time Memory Function Location 1 0.0007 402904 {main}( ) .../index.php:0 2 0.0475 1320416 Joomla\CMS\Application\SiteApplication->execute( ) .../index.php:49 3 0.0475 1320416 Joomla\CMS\Application\SiteApplication->doExecute( ) .../CMSApplication.php:196 4 0.1849 2977376 Joomla\CMS\Application\SiteApplication->dispatch( ) .../SiteApplication.php:233 5 0.1854 3001720 Joomla\CMS\Component\ComponentHelper::renderComponent( ) .../SiteApplication.php:194 6 0.1861 3057048 Joomla\CMS\Component\ComponentHelper::executeComponent( ) .../ComponentHelper.php:377 7 0.1862 3074104 require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) .../ComponentHelper.php:402 8 0.1917 3140856 K2ControllerItemlist->execute( ) .../k2.php:64 9 0.1917 3140856 K2ControllerItemlist->display( ) .../BaseController.php:710 10 0.1950 3229944 K2ControllerItemlist->display( ) .../itemlist.php:49 11 0.1950 3229944 K2ControllerItemlist->display( ) .../controller.php:19 12 0.1961 3248840 Joomla\CMS\Cache\Controller\ViewController->get( ) .../BaseController.php:663 13 0.1990 3269576 K2ViewItemlist->display( ) .../ViewController.php:102 14 0.2479 3714016 K2ViewItemlist->display( ) .../view.html.php:1407 15 0.2479 3714016 K2ViewItemlist->loadTemplate( ) .../HtmlView.php:230 16 0.2499 3784136 include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category.php' ) .../HtmlView.php:701 17 0.2501 3784136 K2ViewItemlist->loadTemplate( ) .../category.php:94 18 0.2514 3864896 include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category_item.php' ) .../HtmlView.php:701
Tip when you install ispconfig 3 behind a reverse proxy like nginx.
In /etc/apache2/sites-available/ispconfig.conf changes '%h' to '%{X-Real-IP}i' to get this:
LogFormat "%v %{X-Real-IP}i %l %u %t \"%r\" %>s %B \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
In order to apache logs for awstats works properly.
I've also defined in my /etc/nginx/nginx.conf config file:
proxy_set_header X-Real-IP $remote_addr;
A better solution will be appreciated