diff --git a/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf index 40ac168..6f6a4f1 100755 --- a/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf @@ -33,33 +33,27 @@ http { add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; + location /data/firmwares { + add_header Access-Control-Allow-Origin *; + } + location /data/ { deny all; } - location ~ .php$ { + location ~ ^/index\.php(/|$) { fastcgi_pass 127.0.0.1:9001; fastcgi_read_timeout 900; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + + internal; } location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ { } - - 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/tasmoadmin/rootfs/etc/nginx/nginx.conf b/tasmoadmin/rootfs/etc/nginx/nginx.conf index 8a52e6b..a871afd 100755 --- a/tasmoadmin/rootfs/etc/nginx/nginx.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx.conf @@ -19,35 +19,26 @@ http { index index.php; location /data/firmwares { + add_header Access-Control-Allow-Origin *; } location /data/ { deny all; } - location ~ .php$ { + location ~ ^/index\.php(/|$) { fastcgi_pass 127.0.0.1:9001; fastcgi_read_timeout 900; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + + internal; } location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ { } - - 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; - } } }