diff --git a/sonweb/rootfs/etc/nginx/nginx-ssl.conf b/sonweb/rootfs/etc/nginx/nginx-ssl.conf index fa28992..26ddabe 100755 --- a/sonweb/rootfs/etc/nginx/nginx-ssl.conf +++ b/sonweb/rootfs/etc/nginx/nginx-ssl.conf @@ -35,6 +35,10 @@ http { add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; + location /data/ { + deny all; + } + location ~ .php$ { fastcgi_pass 127.0.0.1:9001; fastcgi_read_timeout 900; @@ -44,19 +48,20 @@ http { include fastcgi_params; } - location /data/ { - deny all; + location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ { } - rewrite ^/login$ /login.php last; - rewrite ^/logout$ /login.php?logout=logout last; - rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last; - rewrite ^/doAjax$ /index.php?doAjax=doAjax last; - rewrite "/([a-z]{2})/" /index.php?lang=$1 last; - rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3; - rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1; - rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2; - rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2; - rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1; + location / { + rewrite ^/login$ /login.php last; + rewrite ^/logout$ /login.php?logout=logout last; + rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last; + rewrite ^/doAjax$ /index.php?doAjax=doAjax last; + rewrite "/([a-z]{2})/" /index.php?lang=$1 last; + rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3; + rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1; + rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2; + rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2; + rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1; + } } } diff --git a/sonweb/rootfs/etc/nginx/nginx.conf b/sonweb/rootfs/etc/nginx/nginx.conf index c1a8d7d..02c0b97 100755 --- a/sonweb/rootfs/etc/nginx/nginx.conf +++ b/sonweb/rootfs/etc/nginx/nginx.conf @@ -19,6 +19,10 @@ http { root /var/www/sonweb/; index index.php; + location /data/ { + deny all; + } + location ~ .php$ { fastcgi_pass 127.0.0.1:9001; fastcgi_read_timeout 900; @@ -28,19 +32,20 @@ http { include fastcgi_params; } - location /data/ { - deny all; + location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ { } - rewrite ^/login$ /login.php last; - rewrite ^/logout$ /login.php?logout=logout last; - rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last; - rewrite ^/doAjax$ /index.php?doAjax=doAjax last; - rewrite "/([a-z]{2})/" /index.php?lang=$1 last; - rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3; - rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1; - rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2; - rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2; - rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1; + location / { + rewrite ^/login$ /login.php last; + rewrite ^/logout$ /login.php?logout=logout last; + rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last; + rewrite ^/doAjax$ /index.php?doAjax=doAjax last; + rewrite "/([a-z]{2})/" /index.php?lang=$1 last; + rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3; + rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1; + rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2; + rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2; + rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1; + } } }