|
|
@@ -4,47 +4,98 @@
|
|
|
#--MULTISITE--}
|
|
|
|
|
|
location __PATHTOCHANGE__ {
|
|
|
- alias __FINALPATH__/;
|
|
|
- index index.php;
|
|
|
-
|
|
|
- # if (!-e $request_filename)
|
|
|
- # {
|
|
|
- # rewrite ^(.+)$ __PATHTOCHANGE__/index.php?q=$1 last;
|
|
|
- # }
|
|
|
- if ($scheme = http) {
|
|
|
- rewrite ^ https://$server_name$request_uri? permanent;
|
|
|
- }
|
|
|
- client_max_body_size 30m;
|
|
|
-
|
|
|
- # Add headers to serve security related headers
|
|
|
- add_header Strict-Transport-Security "max-age=15768000;";
|
|
|
- add_header X-Content-Type-Options nosniff;
|
|
|
- add_header X-Frame-Options "SAMEORIGIN";
|
|
|
- add_header X-XSS-Protection "1; mode=block";
|
|
|
- add_header X-Robots-Tag none;
|
|
|
- add_header X-Download-Options noopen;
|
|
|
- add_header X-Permitted-Cross-Domain-Policies none;
|
|
|
-
|
|
|
- location ~^/(\.ht)/{
|
|
|
- deny all;
|
|
|
- }
|
|
|
- location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3|pdf)$ {
|
|
|
- # Le contenu statique, est signalé au navigateur comme étant
|
|
|
- # à garder en cache une semaine. Si il y a un proxy sur la
|
|
|
- # route, celui-ci est autorisé à faire une copie et à la
|
|
|
- # cacher.
|
|
|
- expires 1w;
|
|
|
- add_header Cache-Control public;
|
|
|
- }
|
|
|
- location ~ [^/]\.php(/|$) {
|
|
|
- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
|
- fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.sock;
|
|
|
- fastcgi_index index.php;
|
|
|
- include fastcgi_params;
|
|
|
- fastcgi_param REMOTE_USER $remote_user;
|
|
|
- fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
- fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
|
- }
|
|
|
+ alias __FINALPATH__;
|
|
|
+ index index.php;
|
|
|
+
|
|
|
+ if (!-e $request_filename)
|
|
|
+ {
|
|
|
+ # /prestashop/index.php?id_category=5&controller=category
|
|
|
+ rewrite ^/([^/]*)/recherche/(.*)$ __PATHTOCHANGE__/index.php?id_categorie$1&controller$2 last;
|
|
|
+ # rewrite "^__PATHTOCHANGE__/([a-zA-Z]+)/([a-zA-Z]+)$" /index.php?id_category=$1&controller=$2 last;
|
|
|
+ rewrite ^(.+)$ __PATHTOCHANGE__/index.php?q=$1 last;
|
|
|
+ rewrite ^/.*$ __PATHTOCHANGE__/index.php last;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ($scheme = http) {
|
|
|
+ rewrite ^ https://$server_name$request_uri? permanent;
|
|
|
+ }
|
|
|
+
|
|
|
+ client_max_body_size 30m;
|
|
|
+
|
|
|
+ # Add headers to serve security related headers
|
|
|
+ add_header Strict-Transport-Security "max-age=15768000;";
|
|
|
+ add_header X-Content-Type-Options nosniff;
|
|
|
+ add_header X-Frame-Options "SAMEORIGIN";
|
|
|
+ add_header X-XSS-Protection "1; mode=block";
|
|
|
+ add_header X-Robots-Tag none;
|
|
|
+ add_header X-Download-Options noopen;
|
|
|
+ add_header X-Permitted-Cross-Domain-Policies none;
|
|
|
+
|
|
|
+ try_files $uri $uri/ /__PATHTOCHANGE__/index.php?q=$uri&$args;
|
|
|
+
|
|
|
+ # Old image system ?
|
|
|
+ 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;
|
|
|
+
|
|
|
+ # Symfony controllers
|
|
|
+ location ~ /(international|_profiler|module|product|combination|specific-price)/(.*)$ {
|
|
|
+ try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args;
|
|
|
+ }
|
|
|
+
|
|
|
+ # Redirect needed to "hide" index.php
|
|
|
+ # location / {
|
|
|
+ # try_files $uri $uri/ /index.php$uri&$args;
|
|
|
+ # }
|
|
|
+
|
|
|
+ error_page 404 /index.php?controller=404;
|
|
|
+
|
|
|
+ # Deny access to .htaccess .DS_Store .htpasswd etc
|
|
|
+ location ~ /\. {
|
|
|
+ deny all;
|
|
|
+ }
|
|
|
+
|
|
|
+ # Deny access file theme
|
|
|
+ location ~ \.tpl {
|
|
|
+ deny all;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~* \.(css|js|docx|zip|pptx|swf|txt|jpg|jpeg|png|gif|swf|webp|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$ {
|
|
|
+ expires max;
|
|
|
+ log_not_found off;
|
|
|
+ add_header Pragma public;
|
|
|
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ [^/]\.php(/|$) {
|
|
|
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
|
+ fastcgi_pass unix:/var/run/php5-fpm-__NAMETOCHANGE__.sock;
|
|
|
+ fastcgi_index index.php;
|
|
|
+ include fastcgi_params;
|
|
|
+ fastcgi_param REMOTE_USER $remote_user;
|
|
|
+ fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
+ fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
|
+
|
|
|
+ fastcgi_keep_conn on;
|
|
|
+ fastcgi_intercept_errors on;
|
|
|
+ fastcgi_max_temp_file_size 0;
|
|
|
+ fastcgi_temp_file_write_size 256k;
|
|
|
+ fastcgi_buffer_size 8k;
|
|
|
+ fastcgi_buffers 64 8k;
|
|
|
+ fastcgi_busy_buffers_size 8k;
|
|
|
+ fastcgi_connect_timeout 30;
|
|
|
+ fastcgi_read_timeout 30s;
|
|
|
+ fastcgi_send_timeout 30s;
|
|
|
+ client_max_body_size 10m;
|
|
|
+ }
|
|
|
|
|
|
#--PRIVATE--# Include SSOWAT user panel.
|
|
|
#--PRIVATE--include conf.d/yunohost_panel.conf.inc;
|