Add rewrites for json api
This commit is contained in:
parent
6340860ba9
commit
b597ac0971
|
@ -1163,6 +1163,19 @@ function install_web_local_user_interface {
|
||||||
echo '';
|
echo '';
|
||||||
echo ' access_log /dev/null;';
|
echo ' access_log /dev/null;';
|
||||||
echo ' error_log /dev/null;';
|
echo ' error_log /dev/null;';
|
||||||
|
echo '';
|
||||||
|
echo ' location /icons {';
|
||||||
|
echo ' autoindex on;';
|
||||||
|
echo ' break;';
|
||||||
|
echo ' }';
|
||||||
|
echo '';
|
||||||
|
echo ' rewrite ^/plinth/(.*)$ /api.json last;';
|
||||||
|
echo '';
|
||||||
|
echo ' location / {';
|
||||||
|
echo " root /var/www/${local_hostname}/htdocs/plinth;";
|
||||||
|
echo ' index api.json /api.json;';
|
||||||
|
echo " error_page 405 = \$uri;";
|
||||||
|
echo ' }';
|
||||||
echo '}';
|
echo '}';
|
||||||
echo '';
|
echo '';
|
||||||
echo 'server {';
|
echo 'server {';
|
||||||
|
@ -1180,6 +1193,19 @@ function install_web_local_user_interface {
|
||||||
nginx_security_options "${local_hostname}"
|
nginx_security_options "${local_hostname}"
|
||||||
|
|
||||||
{ echo ' add_header Strict-Transport-Security max-age=0;';
|
{ echo ' add_header Strict-Transport-Security max-age=0;';
|
||||||
|
echo '';
|
||||||
|
echo ' location /icons {';
|
||||||
|
echo ' autoindex on;';
|
||||||
|
echo ' break;';
|
||||||
|
echo ' }';
|
||||||
|
echo '';
|
||||||
|
echo ' rewrite ^/plinth/(.*)$ /api.json last;';
|
||||||
|
echo '';
|
||||||
|
echo ' location / {';
|
||||||
|
echo " root /var/www/${local_hostname}/htdocs/plinth;";
|
||||||
|
echo ' index api.json /api.json;';
|
||||||
|
echo " error_page 405 = \$uri;";
|
||||||
|
echo ' }';
|
||||||
echo '}'; } >> "$nginx_file"
|
echo '}'; } >> "$nginx_file"
|
||||||
|
|
||||||
if [ ! -f "/etc/ssl/certs/${local_hostname}.crt" ]; then
|
if [ ! -f "/etc/ssl/certs/${local_hostname}.crt" ]; then
|
||||||
|
|
Loading…
Reference in New Issue