Allow autocompletion behind proxy

When the application is exposed via proxy, i.e. client visible host
(e.g. example.org:443) is different than Ruby server (e.g.
localhost:3000), autocompletion does not work since the generated URLs
refer to the internal hostname.

The AJAX is constructed with root_url and that can be modified with
default_url_options. So the simple fix just allows specifying customized
default_url_options.

Fixes: #1416
This commit is contained in:
Michal Koutný 2022-04-29 02:43:08 +02:00
parent a5fea13526
commit d52893bc58
2 changed files with 9 additions and 0 deletions

View file

@ -35,5 +35,7 @@ module Tracksapp
# configure Tracks to handle deployment in a subdir
config.relative_url_root = SITE_CONFIG['subdir'] if SITE_CONFIG['subdir']
# or deployment behind a proxy
config.action_controller.default_url_options = SITE_CONFIG['default_url_options'] if SITE_CONFIG['default_url_options']
end
end

View file

@ -39,6 +39,13 @@ force_ssl: false
# the relative URL. Mongrel, for example, has a --prefix option.
# subdir: "/tracks"
# Set this to respective values if you're instance is running behind a proxy
# (e.g. localhost:3000 is not the client visible host).
# default_url_options:
# :host: 'example.org'
# :protocol: 'https://'
# :port: 443
# Set to true to allow anyone to sign up for a username.
open_signups: false