TechnoSpain Posted June 23, 2017 Share Posted June 23, 2017 (edited) Hola, Hemos activado en el servidor la compressión gzip, para ello pusimos en nginx este código y funciona correctamente: gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain text/javascript application/javascript application/x-javascript text/xml text/css; gzip_vary on; # Feed location ~* \.(?:rss|atom)$ { expires 1h; add_header Cache-Control "public"; } # Media: images, icons, video, audio, HTC location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1M; access_log off; add_header Cache-Control "public"; rewrite ^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg last; rewrite ^/([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg last; rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$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])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg last; } # CSS and Javascript location ~* \.(?:css|js)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # WebFonts # If you are NOT using cross-domain-fonts.conf, uncomment the following directive location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { expires 1M; access_log off; add_header Cache-Control "public"; } El problema es que tenemos multitienda y las imagenes de la multitienda no se muestran, parece ser que el error puede estar en esta línea que hace que falle la multitienda al tener una multitienda sobre una carpeta. location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { ¿Nos pódeis ayudar con esta línea? ¿cual es la correcta si la url de la multitienda tiene este formato: www.technospain.es/xxxx Edited June 25, 2017 by TechnoSpain (see edit history) Link to comment Share on other sites More sharing options...
TechnoSpain Posted June 25, 2017 Author Share Posted June 25, 2017 SOLUCIONADO Hay que añadir estas líneas en el código de nginx tal y cómo dice la guía oficial: http://doc.prestashop.com/display/PS15/System+Administrator+Guide#SystemAdministratorGuide-NginxfriendlyURLs If your installation of PrestaShop is using the multistore mode, you need to add a few lines for each store. For instance, if one of your stores is called "high-tech": location /PRESTASHOP_FOLDER/high-tech/ { rewrite ^/PRESTASHOP_FOLDER/high-tech/(.*)$ /PRESTASHOP_FOLDER/$1 last; try_files $uri $uri/ /PRESTASHOP_FOLDER/index.php?$args; } Link to comment Share on other sites More sharing options...
tderma Posted June 30, 2018 Share Posted June 30, 2018 Hola TechnoSpain, tengo un problema no pudo hacer que funcione en un Servidor Nginx los Url Amigables, no se si me podrias ayudar poniendo un ejemplo de como lo tienes en tu sitio.. eh estado probando con la documentación y no me funciona. y distintos ejemplos y vi que tu tienes en tu sitio url amigables. De antemano gracias Link to comment Share on other sites More sharing options...
jgamio Posted June 30, 2018 Share Posted June 30, 2018 4 hours ago, tderma said: Hola TechnoSpain, tengo un problema no pudo hacer que funcione en un Servidor Nginx los Url Amigables, no se si me podrias ayudar poniendo un ejemplo de como lo tienes en tu sitio.. eh estado probando con la documentación y no me funciona. y distintos ejemplos y vi que tu tienes en tu sitio url amigables. De antemano gracias Te paso mi configuracion, modifique algo de la original a ver si te sirve de referencia https://github.com/jgamio/Prestashop-Nginx/blob/master/prestashop-nginx.conf Link to comment Share on other sites More sharing options...
tderma Posted July 4, 2018 Share Posted July 4, 2018 Gracias voy a probar a ver si me funciona. 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