JoeSatriani Posted November 16, 2015 Share Posted November 16, 2015 Bonjour, J'ai actuellement un site prestashop 1.6.1.1 qui tourne sur ma machine en local avec nginx. Je souhaite faire un multiboutique sur ce site, pour cela, l'url rewriting doit être configuré. Je l'ai configuré, elle fonctionne pour le site principal mais dès que je crée un autre site en multiboutique, je n'ai plus de CSS sur ma page et mes liens ne fonctionnes plus. Voici ce que j'ai configuré dans mon fichier de config "nginx.conf" location /PAM/ { access_log c:\log.txt; allow 200.100.102.226; allow 200.100.100.0/24; allow 127.0.0.1; deny all; ## Remplacement fichier .htaccess ## ## Début ## rewrite ^/api/?(.*)$ /PAM/webservice/dispatcher.php?url=$1 last; rewrite ^/PAM/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$1$2$3.jpg last; rewrite ^/PAM/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/PAM/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; rewrite ^/PAM/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /PAM/img/c/$1$2$3.jpg last; rewrite ^/PAM/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; rewrite ^/PAM/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /PAM/js/jquery/plugins/fancybox/images/$1.$2 last; try_files $uri $uri/ /PAM/index.php$is_args$args; #error_page 404 /PAM/index.php?controller=404; ## Fin ## } location /PAM/EPI/ { #acces_log off; allow 200.100.102.226; allow 200.100.100.0/24; allow 127.0.0.1; deny all; ## Remplacement fichier .htaccess ## ## Début ## rewrite ^/api/?(.*)$ /PAM/webservice/dispatcher.php?url=$1 last; rewrite ^/PAM/EPI/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$1$2$3.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/PAM/EPI/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?.([_a-zA-Z0-9-]+)\.jpg$ /PAM/img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; # Divers rewrite ^/PAM/EPI/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /PAM/img/c/$1$2$3.jpg last; rewrite ^/PAM/EPI/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; rewrite ^/PAM/EPI/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /PAM/js/jquery/plugins/fancybox/images/$1.$2 last; rewrite ^/PAM/EPI/([0-9]+)-[a-zA-Z0-9-]*.html /PAM/product.php?id_product=$1 last; rewrite ^/PAM/EPI/[a-zA-Z0-9-]*/([0-9]+)-[a-zA-Z0-9-]*.html /PAM/product.php?id_product=$1 last; rewrite ^/PAM/EPI/([0-9]+)-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /PAM/category.php?id_category=$1&noredirect=1 last; rewrite ^/PAM/EPI/([0-9]+)-[a-zA-Z0-9-]* /PAM/category.php?id_category=$1 last; rewrite ^/PAM/EPI/([0-9]+)__([a-zA-Z0-9-]*) /PAM/supplier.php?id_supplier=$1 last; rewrite ^/PAM/EPI/([0-9]+)_([a-zA-Z0-9-]*) /PAM/manufacturer.php?id_manufacturer=$1 last; rewrite ^/PAM/EPI/content/([0-9]+)-([a-zA-Z0-9-]*) /PAM/cms.php?id_cms=$1 last; rewrite ^/PAM/EPI/content/category/([0-9]+)-([a-zA-Z0-9-]*) /PAM/cms.php?id_cms_category=$1 last; # Catégories rewrite ^/PAM/EPI/adresse /PAM/address.php last; rewrite ^/PAM/EPI/adresses /PAM/addresses.php last; rewrite ^/PAM/EPI/authentification /PAM/authentication.php last; rewrite ^/PAM/EPI/meilleures-ventes /PAM/best-sales.php last; rewrite ^/PAM/EPI/panier /PAM/cart.php last; rewrite ^/PAM/EPI/contactez-nous /PAM/contact-form.php last; rewrite ^/PAM/EPI/bons-de-reduction /PAM/discount.php last; rewrite ^/PAM/EPI/suivi-commande-invite /PAM/guest-tracking.php last; rewrite ^/PAM/EPI/historique-des-commandes /PAM/history.php last; rewrite ^/PAM/EPI/identite /PAM/identity.php last; rewrite ^/PAM/EPI/fabricants /PAM/manufacturer.php last; rewrite ^/PAM/EPI/mon-compte /PAM/my-account.php last; rewrite ^/PAM/EPI/nouveaux-produits /PAM/new-products.php last; rewrite ^/PAM/EPI/commande /PAM/order.php last; rewrite ^/PAM/EPI/details-de-la-commande /PAM/order-follow.php last; rewrite ^/PAM/EPI/commande-rapide /PAM/order-opc.php last; rewrite ^/PAM/EPI/avoirs /PAM/order-slip.php last; rewrite ^/PAM/EPI/mot-de-passe-oublie /PAM/password.php last; rewrite ^/PAM/EPI/promotions /PAM/prices-drop.php last; rewrite ^/PAM/EPI/recherche /PAM/search.php last; rewrite ^/PAM/EPI/plan-du-site /PAM/sitemap.php last; rewrite ^/PAM/EPI/magasins /PAM/stores.php last; rewrite ^/PAM/EPI/fournisseurs /PAM/supplier.php last; try_files $uri $uri/ /PAM/index.php$is_args$args; #error_page 404 /PAM/index.php?controller=404; ## Fin ## } Mon site principal (PAM) fonctionne correctement mais pas l'autre (EPI). Voici une photo de mon site en multiboutique (EPI), rien ne s'affiche correctement... (voir image en pj) Est-ce que quelqu'un aurait déjà configurer un nginx avec un multiboutique prestashop ? Merci. Link to comment Share on other sites More sharing options...
Matthieu Malttt Posted January 5, 2016 Share Posted January 5, 2016 Bonjour, Pour le multiboutique, une configuration Nginx comme celle ci fait tourner Merci Capitaine (https://www.mercicapitaine.fr/ et https://www.mercicapitaine.co.uk) depuis quasiment un an maintenant : server { listen *:80; # SSL Part 1 # listen *:443 ssl default_server; # ssl_certificate /etc/ssl/sitename-ssl.crt; # ssl_certificate_key /etc/ssl/sitename-ssl.key; server_name www.sitename.com sitename.com sitename.fr; access_log /var/log/nginx/sitename.access.log; error_log /var/log/nginx/sitename.error.log; root /srv/appfolder; index index.html index.htm index.php; # Avoid heavy request 502 Gateway problem client_max_body_size 30M; # Uncomment fastcgi if PHP or Fast CGI is available # fastcgi_buffers 8 16k; # fastcgi_buffer_size 32k; # fastcgi_connect_timeout 600; # fastcgi_send_timeout 600; # fastcgi_read_timeout 600; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; 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; rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last; try_files $uri $uri/ /index.php$is_args$args; error_page 404 /index.php?controller=404; # SSL Part 2, secured SSL sessions, avoiding heartbleed and some vulnerabilities # ssl_session_timeout 24h; # ssl_session_cache shared:SSL:10m; # ssl_dhparam /etc/ssl/dhparam.pem; # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:RSA+3DES:AES128-SHA:!ADH:!AECDH:!MD5; # ssl_prefer_server_ciphers on; # add_header Strict-Transport-Security max-age=31536000; resolver 127.0.0.1; location ~* \.(eot|ttf|woff|eof|woff2|css|js|jsonp|jpg|jpeg|gif|png|ico|svg|webm|mp3|mp4|avi|mkv|mpg|mpeg|ogg|ogv)$ { # For CDNs add_header Access-Control-Allow-Origin *; # ~ 10 Days expires 604800s; } # Deny access to .htaccess, htpasswd, git, svn and tpls location ~ \.tpl { deny all; } location ~ /\. { deny all; } # PHP (FPM/FCGI) Part, uncomment if available # location ~ [^/]\.php(/|$) { # fastcgi_index index.php; # include fcgi.conf; # fastcgi_pass unix:/var/run/php-fpm.sock; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # } } Je vous suggère de passer par Ajenti (et Ajenti-V) si vous le pouvez sur votre serveur, pour faciliter ce type de configuration. Par ailleurs le multiboutique est plus simple à gérer par google si vous utilisez des sous domaines ou domaines particuliers. Par sous dossier cela me semble dangereux en termes de référencement (risque de duplicate exponentiel). 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