Matthieu Malttt Posted November 10, 2016 Share Posted November 10, 2016 Hi everyone, We are trying to make a perfect nginx / php7-fpm configuration for Prestashop 1.7 so we opened a Github repository about this. You can find it (and maybe improve it) here : https://github.com/MattLoyeD/Prestashop-Nginx Todo : - Improve Symfony Framework compatibility on Product Edit Pages. Feel free to comment or correct anything Matt from Malttt 1 Link to comment Share on other sites More sharing options...
Matthieu Malttt Posted November 14, 2016 Author Share Posted November 14, 2016 New update : - Now working fully with Symfony Controllers in Backoffice. Link to comment Share on other sites More sharing options...
dariodipa Posted December 9, 2016 Share Posted December 9, 2016 Hi Matt, I do not know if it is a problem with the nginx rules but the product combinations do not work correctly On a product with existing combinations: Trying Gen new combinations on a new product: Link to comment Share on other sites More sharing options...
Matthieu Malttt Posted December 12, 2016 Author Share Posted December 12, 2016 As I said in the other topic, this is not already bullet proof, I try to get some insight from email I got at Prestashop. If someone can help, it could be great, my knowledge in Nginx is still no complete I guess. Link to comment Share on other sites More sharing options...
intandem Posted April 27, 2017 Share Posted April 27, 2017 Apologies for the stupid question but where do I place the code that's on Github? Link to comment Share on other sites More sharing options...
zaar Posted May 25, 2017 Share Posted May 25, 2017 the code on the github page is the server configuration you can find this file in etc/nginx/sites-available/your_file OR etc/nginx/sites-enabled/your_file replace your file by the name of your file, by default th file is name default. But if you have multiple site on your server you have problably one file per site. Hope this help. sorry for my bad english. Link to comment Share on other sites More sharing options...
imker Posted August 6, 2018 Share Posted August 6, 2018 hello, with nginx 1.10 and prestashop 1.7.4.0 this rules does not fully work! its missed something, like the cms-section. i found these on the web, but it does also not work! i get a redirect-error: rewrite "^/([0-9]+)\-(\P{M}\p{M}*)+\.html(.*)$" /index.php?controller=product&id_product=$1$3 last; rewrite "^/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=category&id_category=$1$3 last; rewrite "^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" /index.php?controller=product&id_product=$2$4 last; rewrite "^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$" /index.php?controller=supplier&id_supplier=$1$3 last; rewrite "^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$" /index.php?controller=manufacturer&id_manufacturer=$1$3 last; rewrite "^/content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=cms&id_cms=$1$3 last; rewrite "^/content/category/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=cms&id_cms_category=$1$3 last; rewrite "^/module/([_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)$" /index.php?fc=module&module=$1&controller=$2 last; Link to comment Share on other sites More sharing options...
Klemart3D Posted January 21, 2019 Share Posted January 21, 2019 With PS 1.7.5.0, some new back-office Symfony controllers are added : sell, improve and configure, so my new symfony controllers rule into nginx config is: Quote # Symfony controllers location ~ /(sell|improve|configure|international|_profiler|product|feature|attribute|supplier|combination|specific-price)/(.*)$ { try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args; } Link to comment Share on other sites More sharing options...
kibiribi Posted March 21, 2019 Share Posted March 21, 2019 On 5/25/2017 at 3:45 PM, zaar said: the code on the github page is the server configuration you can find this file in etc/nginx/sites-available/your_file OR etc/nginx/sites-enabled/your_file replace your file by the name of your file, by default th file is name default. But if you have multiple site on your server you have problably one file per site. Hope this help. sorry for my bad english. I've got the same problem with ver.17.4 - /index.php/module/manage?_token=G1bj6CImCkM .... Module section doesnt open PHP ver 7.2 , FPM application server by nginx What should I do if I don't have such path for etc ? 😞 how to replace .conf file? Link to comment Share on other sites More sharing options...
polo0000 Posted March 28, 2019 Share Posted March 28, 2019 Hello, On 1/21/2019 at 2:37 PM, Klemart3D said: With PS 1.7.5.0, some new back-office Symfony controllers are added : sell, improve and configure, so my new symfony controllers rule into nginx config is: # Symfony controllers location ~ /(sell|improve|configure|international|_profiler|product|feature|attribute|supplier|combination|specific-price)/(.*)$ { try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args; } With the Klemart3D solution It's work for me. But i have a problem on the page "stock" in "catalog", the page is grey and i have a bug with javascript : Does anyone have the same problem? Thank you! Link to comment Share on other sites More sharing options...
jean7373 Posted August 6, 2019 Share Posted August 6, 2019 hi, i want to convert jpg to webp.... how can i do with nginx? on htaccess rules are: # WebPGenerator Module - Do not edit RewriteRule . - [E=REWRITEBASE:/] # Apache 2.2 <IfModule !mod_authz_core.c> <Files ~ "(?i)^.*\.(webp)$"> Allow from all </Files> </IfModule> # Apache 2.4 <IfModule mod_authz_core.c> <Files ~ "(?i)^.*\.(webp)$"> Require all granted allow from all </Files> </IfModule> <IfModule mod_setenvif.c> SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{DOCUMENT_ROOT}/$1.webp -f RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp] </IfModule> <IfModule mod_headers.c> Header append Vary Accept env=REQUEST_image </IfModule> <IfModule mod_mime.c> AddType image/webp .webp </IfModule> #Domain: www.mondopresepiprova.it RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.webp [L] RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.webp [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.webp [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.webp [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.webp [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.webp [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.webp [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.webp [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/c/$1$2$3.webp [L] RewriteCond %{HTTP_HOST} ^www.mondopresepiprova.it$ RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.webp$ %{ENV:REWRITEBASE}img/c/$1$2.webp [L] # WebPGenerator Module - Do not edit but on nginx i tried everything but no conversione.. i tried this: location ~* ^/.+\.(png|jpg)$ { add_header Vary Accept; try_files $uri$webp_suffix $uri =404; } rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$1$2$3.webp last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$1$2$3$4.webp last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$1$2$3$4$5.webp last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.webp last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.webp last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.webp last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.webp last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.webp$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.webp last; rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.webp$ /img/c/$1$2$3.webp last; rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.webp$ /img/c/$1$2.webp last; what i have to do now? Link to comment Share on other sites More sharing options...
Joyplaz Posted May 7, 2020 Share Posted May 7, 2020 On 3/21/2019 at 10:23 PM, kibiribi said: I've got the same problem with ver.17.4 - /index.php/module/manage?_token=G1bj6CImCkM .... Module section doesnt open PHP ver 7.2 , FPM application server by nginx What should I do if I don't have such path for etc ? 😞 how to replace .conf file? I have the same issue. Did you find a solution? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now