|
server { |
|
listen [::]:80; |
|
listen 80; |
|
|
|
server_name example.com www.example.com; |
|
|
|
return 301 https://www.example.com$request_uri; |
|
} |
|
|
|
server { |
|
listen [::]:443 ssl; |
|
listen 443 ssl; |
|
|
|
server_name example.com; |
|
|
|
include snippets/ssl-params.conf; |
|
|
|
return 301 https://www.example.com$request_uri; |
|
} |
|
|
|
server { |
|
listen [::]:443 ssl deferred; |
|
listen 443 ssl deferred; |
|
|
|
|
|
server_name www.example.com; |
|
|
|
include snippets/ssl-params.conf; |
|
|
|
root /data/nginx/www/prestashop; |
|
access_log /data/nginx/log/example.com.access.log; |
|
error_log /data/nginx/log/example.com.error.log; |
|
|
|
index index.php index.html; # Letting nginx know which files to try when requesting a folder |
|
|
|
include global/acme-challenge.conf # let's encrypt acme-challenge |
|
include global/restrictions.conf; |
|
include global/expires.conf; |
|
|
|
## |
|
# Gzip Settings |
|
## |
|
|
|
gzip on; |
|
gzip_disable "msie6"; # Do people still use Internet Explorer 6? In that case, disable gzip and hope for the best! |
|
gzip_vary on; # Also compress content with other MIME types than "text/html" |
|
gzip_types application/json text/css application/javascript; # We only want to compress json, css and js. Compressing images and such isn't worth it |
|
gzip_proxied any; |
|
gzip_comp_level 6; # Set desired compression ratio, higher is better compression, but slower |
|
gzip_buffers 16 8k; # Gzip buffer size |
|
gzip_http_version 1.0; # Compress every type of HTTP request |
|
|
|
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-]*)/[_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; |
|
rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last; |
|
|
|
# Spanish Friendly URL's - Replace by yours |
|
rewrite '^/alertas-email$' /index.php?controller=module-mailalerts-account last; |
|
rewrite '^/pagina-no-encontrada$' /index.php?controller=pagenotfound last; |
|
rewrite '^/mas-vendidos$' /index.php?controller=best-sales last; |
|
rewrite '^/contactenos$' /index.php?controller=contact last; |
|
rewrite '^/marcas$' /index.php?controller=manufacturer last; |
|
rewrite '^/nuevos-productos$' /index.php?controller=new-products last; |
|
rewrite '^/contrasena-olvidado$' /index.php?controller=password last; |
|
rewrite '^/promocion$' /index.php?controller=prices-drop last; |
|
rewrite '^/mapa-del-sitio$' /index.php?controller=sitemap last; |
|
rewrite '^/proveedores$' /index.php?controller=supplier last; |
|
rewrite '^/direccion$' /index.php?controller=address last; |
|
rewrite '^/direcciones$' /index.php?controller=addresses last; |
|
rewrite '^/autenticacion$' /index.php?controller=authentication last; |
|
rewrite '^/carro-de-la-compra$' /index.php?controller=cart last; |
|
rewrite '^/descuento$' /index.php?controller=discount last; |
|
rewrite '^/historial-de-pedidos$' /index.php?controller=history last; |
|
rewrite '^/identidad$' /index.php?controller=identity last; |
|
rewrite '^/mi-cuenta$' /index.php?controller=my-account last; |
|
rewrite '^/devolucion-de-productos$' /index.php?controller=order-follow last; |
|
rewrite '^/vales$' /index.php?controller=order-slip last; |
|
rewrite '^/carrito$' /index.php?controller=order last; |
|
rewrite '^/buscar$' /index.php?controller=search last; |
|
rewrite '^/tiendas$' /index.php?controller=stores last; |
|
rewrite '^/pedido-rapido$' /index.php?controller=order-opc last; |
|
rewrite '^/estado-pedido$' /index.php?controller=guest-tracking last; |
|
rewrite '^/confirmacion-pedido$' /index.php?controller=order-confirmation last; |
|
rewrite '^/comparar-productos$' /index.php?controller=products-comparison last; |
|
|
|
if (!-e $request_filename){ |
|
rewrite ^(.*)$ /index.php?q=$1 last; |
|
} |
|
|
|
location /api { |
|
rewrite ^/api/(.*)$ /webservice/dispatcher.php?url=$1 break; |
|
} |
|
|
|
location ~ \.php$ { |
|
fastcgi_split_path_info ^(.+\.php)(/.+)$; |
|
try_files $uri =404; |
|
fastcgi_keep_conn on; |
|
fastcgi_index index.php; |
|
fastcgi_pass php:9000; |
|
include fastcgi_params; |
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
|
} |
|
} |