mirror of
https://github.com/hassio-addons/addon-tasmoadmin.git
synced 2025-05-07 04:21:33 +00:00
🚑 Fixes NGinx rewrite rules
This commit is contained in:
parent
e853ef30b3
commit
72b3ea643b
2 changed files with 34 additions and 24 deletions
|
@ -35,6 +35,10 @@ http {
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Robots-Tag none;
|
||||||
|
|
||||||
|
location /data/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
location ~ .php$ {
|
location ~ .php$ {
|
||||||
fastcgi_pass 127.0.0.1:9001;
|
fastcgi_pass 127.0.0.1:9001;
|
||||||
fastcgi_read_timeout 900;
|
fastcgi_read_timeout 900;
|
||||||
|
@ -44,19 +48,20 @@ http {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /data/ {
|
location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ {
|
||||||
deny all;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite ^/login$ /login.php last;
|
location / {
|
||||||
rewrite ^/logout$ /login.php?logout=logout last;
|
rewrite ^/login$ /login.php last;
|
||||||
rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last;
|
rewrite ^/logout$ /login.php?logout=logout last;
|
||||||
rewrite ^/doAjax$ /index.php?doAjax=doAjax last;
|
rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last;
|
||||||
rewrite "/([a-z]{2})/" /index.php?lang=$1 last;
|
rewrite ^/doAjax$ /index.php?doAjax=doAjax last;
|
||||||
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3;
|
rewrite "/([a-z]{2})/" /index.php?lang=$1 last;
|
||||||
rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1;
|
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3;
|
||||||
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2;
|
rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1;
|
||||||
rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2;
|
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2;
|
||||||
rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1;
|
rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2;
|
||||||
|
rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,10 @@ http {
|
||||||
root /var/www/sonweb/;
|
root /var/www/sonweb/;
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
|
location /data/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
location ~ .php$ {
|
location ~ .php$ {
|
||||||
fastcgi_pass 127.0.0.1:9001;
|
fastcgi_pass 127.0.0.1:9001;
|
||||||
fastcgi_read_timeout 900;
|
fastcgi_read_timeout 900;
|
||||||
|
@ -28,19 +32,20 @@ http {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /data/ {
|
location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ {
|
||||||
deny all;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite ^/login$ /login.php last;
|
location / {
|
||||||
rewrite ^/logout$ /login.php?logout=logout last;
|
rewrite ^/login$ /login.php last;
|
||||||
rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last;
|
rewrite ^/logout$ /login.php?logout=logout last;
|
||||||
rewrite ^/doAjax$ /index.php?doAjax=doAjax last;
|
rewrite ^/doAjaxAll$ /index.php?doAjaxAll=doAjaxAll last;
|
||||||
rewrite "/([a-z]{2})/" /index.php?lang=$1 last;
|
rewrite ^/doAjax$ /index.php?doAjax=doAjax last;
|
||||||
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3;
|
rewrite "/([a-z]{2})/" /index.php?lang=$1 last;
|
||||||
rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1;
|
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/([0-9_]+)/?$ /index.php?page=$1&action=$2&device_id=$3;
|
||||||
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2;
|
rewrite ^/([a-zA-Z_]+)/(force)/?$ /index.php?page=$1&force=1;
|
||||||
rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2;
|
rewrite ^/([a-zA-Z_]+)/([a-zA-Z_]+)/?$ /index.php?page=$1&action=$2;
|
||||||
rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1;
|
rewrite ^/([a-zA-Z_]+)/([0-9]+)/?$ /index.php?page=$1&device_id=$2;
|
||||||
|
rewrite ^/([a-zA-Z_]+)/?$ /index.php?page=$1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue