Skip to content

Commit

Permalink
Fix nginx rules for SSL (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse committed Apr 11, 2021
1 parent 1562a82 commit 51b46a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
18 changes: 3 additions & 15 deletions emoncms/rootfs/etc/nginx/nginx-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ 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;
Expand All @@ -60,20 +56,12 @@ http {
include fastcgi_params;
}

location ~ ^(.*)\.(css|js|gif||jpe?g|png|json|cache\.json)$ {
location ~ ^(.*)\.(css|js|gif|jpe?g|png|)$ {
}

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;
index index.php;
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
}
7 changes: 0 additions & 7 deletions emoncms/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ http {
root /var/www/emoncms;
index index.php;

location /data/firmwares {
}

location /data/ {
deny all;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_read_timeout 900;
Expand Down

0 comments on commit 51b46a2

Please sign in to comment.