This PR implements the changes I mentioned in issue #27, namely forwarding the required headers along to the NextJS server, and extracting the required headers from its response.
I also wanted to note that in order for nginx to forward the Rsc header to Django, you need something like the following:
location / {
set $upstream_app MY_DJANGO_URL;
proxy_pass http://$upstream_app:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-Ip $proxy_add_x_forwarded_for;
proxy_pass_header Rsc; # < ----- This needs to be added
}
I think this is worth documenting since the README has a recommended nginx config already but I wasn't sure how best to include it since the sample config doesn't have a location block for Django.
This PR implements the changes I mentioned in issue #27, namely forwarding the required headers along to the NextJS server, and extracting the required headers from its response.
I also wanted to note that in order for nginx to forward the
Rsc
header to Django, you need something like the following:I think this is worth documenting since the README has a recommended nginx config already but I wasn't sure how best to include it since the sample config doesn't have a
location
block for Django.