From 260e1d4f2dcd36f72531a68c4bc6b53166952bb6 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Fri, 2 Sep 2022 13:12:06 -0400 Subject: [PATCH] Make static asset location consistent across all deployments (#12819) --- awx/settings/development.py | 4 ---- tools/docker-compose/nginx.vh.default.conf | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/awx/settings/development.py b/awx/settings/development.py index e39f05dfc8..bd76582aa6 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -108,10 +108,6 @@ AWX_DISABLE_TASK_MANAGERS = False if 'sqlite3' not in DATABASES['default']['ENGINE']: # noqa DATABASES['default'].setdefault('OPTIONS', dict()).setdefault('application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63]) # noqa -# Everywhere else we use /var/lib/awx/public/static/ - but this requires running collectstatic. -# This makes the browsable API work in the dev env without any additional steps. -STATIC_ROOT = os.path.join(BASE_DIR, 'public', 'static') - # If any local_*.py files are present in awx/settings/, use them to override # default settings for development. If not present, we can still run using # only the defaults. diff --git a/tools/docker-compose/nginx.vh.default.conf b/tools/docker-compose/nginx.vh.default.conf index 959d4e2151..54a129ee19 100644 --- a/tools/docker-compose/nginx.vh.default.conf +++ b/tools/docker-compose/nginx.vh.default.conf @@ -25,10 +25,7 @@ server { add_header X-Content-Type-Options nosniff; location /static/ { - root /awx_devel; - try_files /awx/ui/$uri /awx/$uri /awx/public/$uri =404; - access_log off; - sendfile off; + alias /var/lib/awx/public/static/; } location /favicon.ico { alias /awx_devel/awx/public/static/favicon.ico; }