Closed se7entyse7en closed 5 years ago
I haven't tested this by running bblfsh/web behind a Kubernetes proxy as written in issue #177, but for simplicity I've used nginx (I suppose that it should be the same) with the following configuration:
server {
listen 8081;
server_name localhost;
location /bblfsh/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
where bblfsh/web was running on port 8080
.
With this setup bblfsh/web works correctly both by using it directly through localhost:8080
and by using it behind nginx through localhost:8081/bblfsh
.
@smola this PR doesn't change the way how SERVER_URL
works. bblfsh/web is different from other our project where we set SERVER_URL
dynamically. Here we use it during build step. But this change of the default allowed relative urls to work.
Closes #177 as it makes bblfsh/web work both directly and behind a proxy with path other than
/
.