Prestashop Template / PHP5-FPM + NGINX
Prestashop Template / PHP5-FPM + NGINX
Hi
Does anyone have a prestashop template for PHP5-FPM + NGINX?
Thanks
.J.
Does anyone have a prestashop template for PHP5-FPM + NGINX?
Thanks
.J.
Last edited by mephivio on Sat Nov 14, 2015 4:00 pm, edited 1 time in total.
Re: Prestashop Template / PHP5-FPM
default does not suit prestashop?
Re: Prestashop Template / PHP5-FPM
if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: Prestashop Template / PHP5-FPM
If that works through .htaccess file than it's normal that it doesn't work. Nginx can't handle this.mephivio wrote:if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
Re: Prestashop Template / PHP5-FPM
tjebbeke wrote:If that works through .htaccess file than it's normal that it doesn't work. Nginx can't handle this.mephivio wrote:if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
Maybe you can make your own template with the settings mentioned in this link http://doc.prestashop.com/display/PS16/ ... iendlyURLs ?
Re: Prestashop Template / PHP5-FPM + NGINX
How about test template for PrestaShop?mephivio wrote: Does anyone have a prestashop template for PHP5-FPM + NGINX?
Can you be my favorite "lab rat"? ;-)
Re: Prestashop Template / PHP5-FPM + NGINX
Ok - i worked on this template - it works
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Custom Prestashop 404 page
#error_page 404 /index.php?controller=404;
location / {
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
add_header Access-Control-Allow-Headers Content-Type;
add_header Access-Control-Max-Age 86400;
try_files $uri $uri/ /index.php?$args;
location ~* \.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$1$2.$4 last;
rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$1$2$3.$5 last;
rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$1$2$3$4.$6 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.$7 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.$8 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.$9 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.$10 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.$11 last;
rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.(.*)$ /img/c/$1$2.$4 last;
rewrite ^/c/([a-zA-Z-]+)(-[0-9]+)?/.+\.(.*)$ /img/c/$1.$3 last;
rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.(.*)$ /img/c/$1$2.$4 last;
# AlphaImageLoader for IE and fancybox
rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
access_log off;
log_not_found off;
expires 1w;
add_header Cache-Control public;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_pass %backend_lsnr%;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Custom Prestashop 404 page
#error_page 404 /index.php?controller=404;
location / {
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
add_header Access-Control-Allow-Headers Content-Type;
add_header Access-Control-Max-Age 86400;
try_files $uri $uri/ /index.php?$args;
location ~* \.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$1$2.$4 last;
rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$1$2$3.$5 last;
rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$1$2$3$4.$6 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.$7 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.$8 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.$9 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.$10 last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.(.*)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.$11 last;
rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.(.*)$ /img/c/$1$2.$4 last;
rewrite ^/c/([a-zA-Z-]+)(-[0-9]+)?/.+\.(.*)$ /img/c/$1.$3 last;
rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.(.*)$ /img/c/$1$2.$4 last;
# AlphaImageLoader for IE and fancybox
rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
access_log off;
log_not_found off;
expires 1w;
add_header Cache-Control public;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_pass %backend_lsnr%;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}