Static Media Failure #3731

Closed
opened 2025-12-29 18:30:49 +01:00 by adam · 1 comment
Owner

Originally created by @emmanuelhaine on GitHub (May 27, 2020).

Hi, I'm facing this issue with nginx webserver and I'm referecing the static directory:

server {
listen 80;
listen [::]:80;
server_name xxx;

return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
listen [::]:443 ssl;

server_name xxx;

ssl_certificate           xxx;
ssl_certificate_key       xxx;

ssl_session_cache  builtin:1000  shared:SSL:10m;
ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;

access_log            xxxx;
error_log            xxxx;

client_max_body_size 25m;

location /static/ {
    alias /opt/netbox/netbox/static/;
}

location / {
   proxy_pass http://127.0.0.1:8001;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}

}

Environment

  • Python version: python3-3.6.8-13
  • NetBox version: 2.8.4

Steps to Reproduce

  1. CentOS 8
  2. Nginx

Expected Behavior

Acess the application without any problem

Observed Behavior

Static Media Failure
The following static media file failed to load: flatpickr-4.6.3/themes/light.css

Check the following:

manage.py collectstatic was run during the most recent upgrade. This installs the most recent iteration of each static file into the static root path.
The HTTP service (e.g. nginx or Apache) is configured to serve files from the STATIC_ROOT path. Refer to the installation documentation for further guidance.
    STATIC_URL: /static/
The file flatpickr-4.6.3/themes/light.css exists in the static root directory and is readable by the HTTP process.

Click here to attempt loading NetBox again.

Originally created by @emmanuelhaine on GitHub (May 27, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> Hi, I'm facing this issue with nginx webserver and I'm referecing the static directory: server { listen 80; listen [::]:80; server_name xxx; return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name xxx; ssl_certificate xxx; ssl_certificate_key xxx; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_prefer_server_ciphers on; access_log xxxx; error_log xxxx; client_max_body_size 25m; location /static/ { alias /opt/netbox/netbox/static/; } location / { proxy_pass http://127.0.0.1:8001; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; } } ### Environment * Python version: python3-3.6.8-13 * NetBox version: 2.8.4 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. CentOS 8 2. Nginx 3. <!-- What did you expect to happen? --> ### Expected Behavior Acess the application without any problem <!-- What happened instead? --> ### Observed Behavior Static Media Failure The following static media file failed to load: flatpickr-4.6.3/themes/light.css Check the following: manage.py collectstatic was run during the most recent upgrade. This installs the most recent iteration of each static file into the static root path. The HTTP service (e.g. nginx or Apache) is configured to serve files from the STATIC_ROOT path. Refer to the installation documentation for further guidance. STATIC_URL: /static/ The file flatpickr-4.6.3/themes/light.css exists in the static root directory and is readable by the HTTP process. Click here to attempt loading NetBox again.
adam closed this issue 2025-12-29 18:30:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 27, 2020):

This issue has been closed as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).

@jeremystretch commented on GitHub (May 27, 2020): This issue has been closed as it does not conform to one of the [provided templates](https://github.com/netbox-community/netbox/issues/new/choose) as required by the [contributing guide](https://github.com/netbox-community/netbox/blob/master/CONTRIBUTING.md). If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3731