Skip to content

Conversation

@se7entyse7en
Copy link
Member

Closes #177 as it makes bblfsh/web work both directly and behind a proxy with path other than /.

@se7entyse7en
Copy link
Member Author

se7entyse7en commented Jan 8, 2019

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.

Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Copy link
Member

@smola smola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to document SERVER_URL in the README. It's worth noting that, while it's not required, it's encouraged to set it to the public URL to ensure that shared URLs are correct.

@smacker
Copy link
Collaborator

smacker commented Jan 10, 2019

@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.

@se7entyse7en se7entyse7en merged commit 62b87fd into bblfsh:master Jan 10, 2019
@se7entyse7en se7entyse7en deleted the behind-proxy branch January 10, 2019 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants