[Wharfie] Serve Zamboni static/media assets through nginx rather than runserver

RESOLVED FIXED

Status

Marketplace
General
P3
normal
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: jkerim, Assigned: scolville)

Tracking

Avenir
x86
Mac OS X
Points:
---

Details

(Whiteboard: [qa-])

(Reporter)

Description

4 years ago
Presently, static assets are hosted directly using runserver which clutters the requests to Zamboni.  There should be a rule in nginx which hosts the static assets for the devhub directly.
(Reporter)

Updated

4 years ago
Blocks: 1011198
(Reporter)

Comment 1

4 years ago
Hint:

        # Conditionally handle media depending on where we are using referer (sic) header.
        location /media {
            proxy_set_header Host $host;
            if ($http_referer  ~ '^http://[^/]*?/mozpay') {
                proxy_pass http://webpay;
                break;
            }
            if ($http_referer !~ '^http://[^/]*?/(admin|developers|login\?to=/(admin|reviewers|developers)|files|lookup|media/css/(ecosystem|devreg|gaia|mkt)|reviewers|services)') {
                proxy_pass http://fireplace;
                break;
            }
            alias /home/ubuntu/zamboni/media/;
       }
    }

Updated

4 years ago
Priority: -- → P3
We should avoid at all costs needing the referer config, as it's a massive pain to maintain. 

This should be fine though as zamboni is now serving fireplace we shouldn't have conflicting /media locations.
Assignee: nobody → scolville
Status: NEW → ASSIGNED
https://github.com/mozilla/wharfie/commit/82e013900e6fe7a977565aa8c27dd55bd14eb497
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.