Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ansible/roles/ooni-backend/templates/nginx-api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ server {
}

# Selectively route test-list/urls to the API
location ~^/api/v1/test-list/(urls|tor-targets) {
location ~^/api/v1/test-list/urls {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand All @@ -106,6 +106,18 @@ server {
add_header X-Content-Type-Options nosniff always;
}

# reverse proxy test-list/urls, test-list/psiphon-config, test-list/tor-targets endpoints
location ~^/api/v1/test-list/(tor-targets|psiphon-config) {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $external_remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;

proxy_pass https://ooniprobe.prod.ooni.io:443;
}

# Orchestrate
# Should match:
# - /api/v1/test-list
Expand Down
1 change: 1 addition & 0 deletions tf/environments/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ module "ooniapi_ooniprobe" {
COLLECTOR_ID = 3 # use a different one in prod
CONFIG_BUCKET = aws_s3_bucket.ooni_private_config_bucket.bucket
TOR_TARGETS = "tor_targets.json"
PSIPHON_CONFIG = "psiphon_config.json"
ANONC_MANIFEST_BUCKET = aws_s3_bucket.anoncred_manifests.bucket
ANONC_MANIFEST_FILE = "manifest.json"
}
Expand Down
1 change: 1 addition & 0 deletions tf/environments/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ module "ooniapi_ooniprobe" {
COLLECTOR_ID = 4 # be sure this is different from dev
CONFIG_BUCKET = aws_s3_bucket.ooni_private_config_bucket.bucket
TOR_TARGETS = "tor_targets.json"
PSIPHON_CONFIG = "psiphon_config.json"
ANONC_MANIFEST_BUCKET = aws_s3_bucket.anoncred_manifests.bucket
ANONC_MANIFEST_FILE = "manifest.json"
}
Expand Down
3 changes: 2 additions & 1 deletion tf/modules/ooniapi_frontend/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ resource "aws_lb_listener_rule" "ooniapi_ooniprobe_rule_4" {
"/bouncer/net-tests*",
"/api/v1/geolookup*",
"/api/v1/collectors*",
"/api/v1/test-list/tor-targets"
"/api/v1/test-list/tor-targets",
"/api/v1/test-list/psiphon-config"
]
}
}
Expand Down
Loading