Skip to content

Commit

Permalink
nginx: Add metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe2k committed Jun 28, 2024
1 parent 321f6f1 commit 433ee64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions deploy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ server {
client_max_body_size 10M;
}

location ~ ^/metrics {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

# FIXME: Not sure if there's a clean way to combine this with the previous block
location = / {
proxy_pass http://127.0.0.1:8000;
Expand Down
10 changes: 10 additions & 0 deletions hub/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
MEDIA_ROOT = DATA_DIR / "media"
MEDIA_URL = "/media/"

ALLOWED_HOSTS = [
"hub.indiaultimate.org",
"upai-hub.fly.dev",
"upai-hub-staging.fly.dev",
"127.0.0.1",
"localhost",
gethostname(),
gethostbyname(gethostname()),
]

SENTRY_DSN = os.environ.get("SENTRY_DSN")
if SENTRY_DSN:
import sentry_sdk
Expand Down
2 changes: 0 additions & 2 deletions hub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"upai-hub-staging.fly.dev",
"127.0.0.1",
"localhost",
gethostname(),
gethostbyname(gethostname()),
]

# Application definition
Expand Down

0 comments on commit 433ee64

Please sign in to comment.