Here is the situation. I've setup prestashop 1.7.1 on an ubuntu 14.04 VM running Ajenti, so its php-fpm and nginx for me. After looking through a lot of tutorials and some custom configuration i managed to get everything working just fine. However i just installed a new module and when calling the php file that does the work (generates xml) i am served with the file instead of the proccessed result.I checked file permissions and i even tried 777 on all files. I've noted where the problem is, y nginx configuration is:
set $admin_dir /admin_folder;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
# Supposed to be the case but we never know
# text/html;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# Old image system ?
rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last;
rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last;
rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last;
#Symfony controllers
location ~ /(international|_profiler|modules|product|combination|specific-price|attachment)/(.*)$ {
try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
error_page 404 /index.php?controller=404;
add_header Strict-Transport-Security max-age=31536000;
location ~ /\. {
deny all;
}
location ~ \.tpl {
deny all;
}
location ~ ^/admin_folder/index.php/(.*) {
if (!-e $request_filename) {
rewrite ^/.*$ /admin_folder/index.php last;
}
}
location ~ /en/index.php {
rewrite ^/en/index\.php$ /index.php redirect;
}
location ~ /el/index.php {
rewrite ^/el/index\.php$ /index.php redirect;
}
location ^~ /modules/xmlfeeds/api/xml.php {
#Here is the problem
return 501;
}
Any suggestions?