Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Prestashop Template / PHP5-FPM + NGINX

General questions about VestaCP
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
mephivio
Posts: 198
Joined: Thu Mar 27, 2014 7:35 am

Os: Debian 8x
Web: nginx + php-fpm
Prestashop Template / PHP5-FPM + NGINX
  • Quote

Post by mephivio » Fri Nov 13, 2015 7:02 pm

Hi
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.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Prestashop Template / PHP5-FPM
  • Quote

Post by skurudo » Fri Nov 13, 2015 8:20 pm

default does not suit prestashop?
Top

mephivio
Posts: 198
Joined: Thu Mar 27, 2014 7:35 am

Os: Debian 8x
Web: nginx + php-fpm
Re: Prestashop Template / PHP5-FPM
  • Quote

Post by mephivio » Sat Nov 14, 2015 3:43 pm

if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Prestashop Template / PHP5-FPM
  • Quote

Post by tjebbeke » Sat Nov 14, 2015 7:51 pm

mephivio wrote:if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
If that works through .htaccess file than it's normal that it doesn't work. Nginx can't handle this.
Top

itsme
Posts: 2
Joined: Fri Jun 12, 2015 7:06 am

Re: Prestashop Template / PHP5-FPM
  • Quote

Post by itsme » Sun Nov 15, 2015 10:12 am

tjebbeke wrote:
mephivio wrote:if you activate URL rewriting, it stops to work .... in addition with default template in NGINX
If that works through .htaccess file than it's normal that it doesn't work. Nginx can't handle this.

Maybe you can make your own template with the settings mentioned in this link http://doc.prestashop.com/display/PS16/ ... iendlyURLs ?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Prestashop Template / PHP5-FPM + NGINX
  • Quote

Post by skurudo » Sun Nov 15, 2015 4:26 pm

mephivio wrote: Does anyone have a prestashop template for PHP5-FPM + NGINX?
How about test template for PrestaShop?
Can you be my favorite "lab rat"? ;-)
Top

mephivio
Posts: 198
Joined: Thu Mar 27, 2014 7:35 am

Os: Debian 8x
Web: nginx + php-fpm
Re: Prestashop Template / PHP5-FPM + NGINX
  • Quote

Post by mephivio » Mon Nov 16, 2015 8:53 pm

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;
}
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password