So I have been able to fix this with nginx. I gave up on workers as I don’t know much about them…
The idea is that my root domain will point to a server I control, and I’ll let nginx merge the two platforms together.
server
{
listen 80;
server_name test.ultraluz.com.br;
location /blog {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /stylesheets {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/stylesheets;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /assets {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/assets;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /svg-sprite {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/svg-sprite;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /404-body {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/404-body;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /message-bus {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/message-bus;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /latest.json {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/latest.json;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /javascripts {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/javascripts;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /logs {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/logs;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /u {
proxy_set_header Host forum.ultraluz.com.br;
proxy_pass https://forum.ultraluz.com.br/u;
proxy_redirect https://forum.ultraluz.com.br/ http://test.ultraluz.com.br/blog;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
This works, but I only have one issue. When people go to /blog
they see the discourse 404 page doesn’t exist instead of the homepage? I’m not sure what could be causing this?