We currently have nginx sitting in front of our puma app servers (serving rails apps). Recently we've separated out 'marketing' pages into it's own repo and app.
So essentially we have static content served by app deploy on the netlify, but we have our rails app take over once users are logged in.
Any advice how to set this one up? So we use one domain for both of these? Initially we were thinking to create a subdomain for static content like (static.mydomain.com) and serve everything from there, but that approach has major downsides (domain and subdomain don't have the same SEO).
Can nginx do some kind of url rewrite so our static app on netlify appears under our domain? Or has anyone solved this problem differently?
Update:
I was able to use suggestion from Josh and ended up with this :
server {
...
location ^~ /about { proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://yourdeployment.netlify.com/about; } }
Now however there are some resources (js/css/json) that netlify loads from roor url http://yourdeployment.netlify.com/somescrip-someshavalue.sj that my nginx is starting to get from mydomain.com .
Is there way I can intercept these or I have to manually add redirect rules as in add location block for each of the resources ?