I am using nginx, serving two Phoenix apps:
upstream phoenix1 {
server 127.0.0.1:4001 max_fails=5 fail_timeout=60s;
keepalive 32;
}
upstream phoenix2 {
server 127.0.0.1:4002 max_fails=5 fail_timeout=60s;
keepalive 32;
}
server {
...
location /p1 {
proxy_pass http://phoenix1/;
proxy_http_version 1.1;
proxy_set_header X-Cluster-Client-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
access_log /var/log/p1.access.log;
error_log /var/log/p1.error.log;
}
location /p2 {
proxy_pass http://phoenix2/;
proxy_http_version 1.1;
proxy_set_header X-Cluster-Client-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
access_log /var/log/p2.access.log;
error_log /var/log/p2.error.log;
}
...
}
I then launch the app and browse to /p1 and /p2 successfully; the gist of your typical Phoenix app is served. Assets however are not; they are expected at, in both cases, /assets/.
Is there a way at build+deployment time to prefix each project’s asset path by, say /resources1 and /resources2, respectively ?
Thanks.