Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a base url for proxies #183

Open
kordianbruck opened this issue Nov 4, 2017 · 5 comments
Open

Add a base url for proxies #183

kordianbruck opened this issue Nov 4, 2017 · 5 comments

Comments

@kordianbruck
Copy link

kordianbruck commented Nov 4, 2017

Hey,

I'm running this using the docker image and nginx. I use nginx to reverse proxy the requests to the docker image. Unfortunately you guys use absolute paths and have no means on how to set the base url for the app. So the assets cannot be loaded as they mismatch to / while the app is actually being served from /beta/ with a location match.

For reference gogs lets you set the base url in the config: gogs/gogs#1844

Proxy config:

location /beta/ {
            proxy_pass  http://127.0.0.1:3000/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto https;
            proxy_redirect    off;
}

Ideally one could set this using a ENV variable. Alternatively you will use relative paths - might not be the smartest solution.

@joshdholtz
Copy link
Member

@kordianbruck Are you able to submit a PR for this? 😊

@kordianbruck
Copy link
Author

@joshdholtz I wouldn't know much about ruby really. But I'm happy to try. Any hints?

@joshdholtz
Copy link
Member

@kordianbruck I always just look at other code examples while learning new languages 🙃

@maxep
Copy link

maxep commented Jul 13, 2018

Hey! You can set the RAILS_RELATIVE_URL_ROOT variable

@bunnyc1986
Copy link

the submit button also needs to be fixed after setting RAILS_RELATIVE_URL_ROOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants