openvibers/openvibe.search Commits
Search: nginx refuses /internal/ and /metrics case-insensitively (#25)
Changes
@@@ -74,7 +74,7 @@ server {location = /release.json { proxy_pass http://127.0.0.1:4710; }# Metrics are for host-local scrapers only (http://127.0.0.1:4710/metrics).-- location = /metrics { return 404; }++ location ~* ^/metrics(/|$) { return 404; }# ── Search page ─────────────────────────────────────────location = / {@@@ -26,7 +26,7 @@ t('wildcard certificate and client address from $remote_addr only', () => {});t('/metrics is 404; owner API, webhook and document writes are loopback-only', () => {-- assert.match(conf, /location = \/metrics \{ return 404; \}/);++ assert.match(conf, /location ~\* \^\/metrics\(\/\|\$\) \{ return 404; \}/, '/metrics in any letter case');assert.match(block('location = /updates'), /limit_except GET \{ deny all; \}/, 'the update log, GET only');assert.match(conf, /location \^~ \/shared\/ \{ limit_except GET \{ deny all; \} proxy_pass http:\/\/127\.0\.0\.1:4710; \}/, 'the site\'s own Frame files');assert.match(block('location ^~ /internal/'), loopbackOnly);
@@ -74,7 +74,7 @@ server {
@@ -74,7 +74,7 @@ server {
location = /release.json { proxy_pass http://127.0.0.1:4710; }
location = /release.json { proxy_pass http://127.0.0.1:4710; }
# Metrics are for host-local scrapers only (http://127.0.0.1:4710/metrics).
# Metrics are for host-local scrapers only (http://127.0.0.1:4710/metrics).
- location = /metrics { return 404; }
+ location ~* ^/metrics(/|$) { return 404; }
# ── Search page ─────────────────────────────────────────
# ── Search page ─────────────────────────────────────────
location = / {
location = / {
@@ -26,7 +26,7 @@ t('wildcard certificate and client address from $remote_addr only', () => {
@@ -26,7 +26,7 @@ t('wildcard certificate and client address from $remote_addr only', () => {
});
});
t('/metrics is 404; owner API, webhook and document writes are loopback-only', () => {
t('/metrics is 404; owner API, webhook and document writes are loopback-only', () => {
- assert.match(conf, /location = \/metrics \{ return 404; \}/);
+ assert.match(conf, /location ~\* \^\/metrics\(\/\|\$\) \{ return 404; \}/, '/metrics in any letter case');
assert.match(block('location = /updates'), /limit_except GET \{ deny all; \}/, 'the update log, GET only');
assert.match(block('location = /updates'), /limit_except GET \{ deny all; \}/, 'the update log, GET only');
assert.match(conf, /location \^~ \/shared\/ \{ limit_except GET \{ deny all; \} proxy_pass http:\/\/127\.0\.0\.1:4710; \}/, 'the site\'s own Frame files');
assert.match(conf, /location \^~ \/shared\/ \{ limit_except GET \{ deny all; \} proxy_pass http:\/\/127\.0\.0\.1:4710; \}/, 'the site\'s own Frame files');
assert.match(block('location ^~ /internal/'), loopbackOnly);
assert.match(block('location ^~ /internal/'), loopbackOnly);