Answer the question
In order to leave comments, you need to log in
Nginx return contents of Opencart php file?
There is a site on Opencart running on a bunch of Nginx + php5-fpm. everything is fine - except for one problem! One of the modules emits the contents of itself (php) instead of processing the request. In general, for example:
paths are processed as expected:
to the products site.ru/index.php?route=product/product&product_id=11
to one of the modules site.ru/index.php?route=product/pricelist
And here is the request site.ru/ index.php?route= module/click/order returns the content of the file.
(Moreover, click is a module file, order is a function in it)
There is no such problem in an exact copy of the Apache site!!! therefore, I pear on my knowledge of the nginx settings, the
main content of the Nginx settings file for the site:
server {
listen 80;
server_name site.ru;
server_tokens off;
client_body_buffer_size 128k;
charset utf8;
client_max_body_size 500m;
root /var/www/web/site.ru;
index index.php;
location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { expires 365d; }
location /admin { index index.php; }
location / { try_files $uri @opencart; }
location @opencart { rewrite ^/(.+)$ /index.php?_route_=$1 last; }
rewrite ^/sitemap.xml$ /index.php?route=feed/google_sitemap;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Answer the question
In order to leave comments, you need to log in
htaccess standard let's say so!
Options +FollowSymlinks
Options -Indexes
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteEngine On
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question