This repository was archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
Using Fireplace with Zamboni
Andy McKay edited this page Aug 30, 2013
·
10 revisions
If you want to run Fireplace locally in a way that's similar to
production, you can use nginx.
This snippet is an nginx.conf example. You'll probably want to
edit the port numbers to match your own configuration.
Snippet:
http {
...
# Change this to update where your fireplace is running.
upstream fireplace {
server localhost:8675;
}
# Change this to reflect where your zamboni is running.
upstream zamboni {
server localhost:8002;
}
# Change this to reflect where your webpay is running.
# Optional - only needed if you're testing payments.
upstream webpay {
server localhost:9000;
}
server {
# Listening on port 80 is nice but you have to start nginx
# with the right permissions.
listen 80 default;
# Set a host name. You also have to alias this host to
# 127.0.0.1 in /etc/hosts
server_name fireplace.local;
location / {
# Default to fireplace.
proxy_pass http://fireplace;
proxy_set_header Host $host;
}
location /webpay/ {
# This is an optional alias to your local Webpay server
# so you can process payments.
proxy_pass http://webpay;
proxy_set_header Host $host;
}
# Conditionally pass Zamboni urls to Zamboni.
location ~ '^/(admin|addons|api|developers|jsi18n\.js|login|logout|lookup|reviewers|services|tmp)' {
proxy_pass http://zamboni;
proxy_set_header Host $host;
}
# Conditionally handle /users for both Zamboni and Fireplace.
location /users {
proxy_set_header Host $host;
if ($http_referer ~ '^http://[^/]*?/(developers|reviewers|login\?to=/(admin|reviewers|developers))') {
proxy_pass http://zamboni;
break;
}
proxy_pass http://fireplace;
}
# Conditionally handle media depending on where we are using referer (sic) header.
location /media {
proxy_set_header Host $host;
if ($http_referer ~ '^http://[^/]*?/(admin|developers|login\?to=/(admin|reviewers|developers)|lookup|media/css/(ecosystem|devreg|gaia|mkt)|reviewers|services)') {
proxy_pass http://zamboni;
break;
}
if ($http_referer ~ '^http://[^/]*?/mozpay') {
proxy_pass http://webpay;
break;
}
proxy_pass http://fireplace;
}
}
}