Welcome! Log In Create A New Profile

Advanced

Reverse Proxy Config Issue with Joomla SEF URL's

Posted by jimhill10 
Reverse Proxy Config Issue with Joomla SEF URL's
April 13, 2016 09:34AM
We have a reverse proxy setup such that NGINX serves cached Joomla (v. 3.5) content. One issue we have is that in the cache folder an index.php file is being created containing only the text string "sefs updated." This then breaks the display of any non-SEF URL like index.php?option-com_content.... The site uses friendly URL generated by SH404SEF. Our server section in that portion of the www.domainname.com.conf file looks like this. What should be change such that index.php isn't cached? Once we delete the index.php file which arises inside the cache folder the non-sef content displays just fine. But it comes back time and time again and has to be deleted from the cache store.


server_name_in_redirect off;
root /var/www/cache/nginx;
index index.php index.html;

error_page 566 = @post;

if ($request_method = POST) { return 566; }

set $original_uri $uri;

if ($uri = /) { set $original_uri "index.html"; }
#if ($uri = /) { return 566; }


location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
root /var/www/html;
}

location ~* \.(ico|pdf|flv)$ {
expires 1y;
root /var/www/html;
error_page 404 = @stor;
}

location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|svg|pdf)$ {
expires 14d;
root /var/www/html;
error_page 404 = @stor;
}

location / {
#try_files /var/www/cache/nginx/$original_uri @stor;
default_type text/html;
error_page 403 404 = @stor;
}


Plus some exclusions ....
Re: Reverse Proxy Config Issue with Joomla SEF URL's
April 13, 2016 11:42AM
This is what our expert implemented:

server_name_in_redirect off;
root /var/www/cache/nginx;
index index.html;

error_page 566 = @post;

if ($request_method = POST) { return 566; }

if ($is_args = "?") {
return 566;
}


set $original_uri $uri;

if ($uri = /) { set $original_uri "index.html"; }
#if ($uri = /) { return 566; }


location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
root /var/www/html;
}

location ~* \.(ico|pdf|flv)$ {
expires 1y;
root /var/www/html;
error_page 404 = @stor;
}

location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|svg|pdf)$ {
expires 14d;
root /var/www/html;
error_page 404 = @stor;
}

location / {
#try_files /var/www/cache/nginx/$original_uri @stor;
default_type text/html;
error_page 403 404 = @stor;
}
Re: Reverse Proxy Config Issue with Joomla SEF URL's
April 13, 2016 02:39PM
NGINX didn't appreciate our changes. Has anyone experience in virtual config of caching with Joomla?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready