mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix parsing TRUSTED_PROXY_IP
(#18051)
This commit is contained in:
parent
50a088fd77
commit
5781d1db84
@ -42,7 +42,7 @@ Rails.application.configure do
|
|||||||
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||||
|
|
||||||
# Allow to specify public IP of reverse proxy if it's needed
|
# Allow to specify public IP of reverse proxy if it's needed
|
||||||
config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split.map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?
|
config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split(/(?:\s*,\s*|\s+)/).map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?
|
||||||
|
|
||||||
config.force_ssl = true
|
config.force_ssl = true
|
||||||
config.ssl_options = {
|
config.ssl_options = {
|
||||||
|
@ -146,7 +146,7 @@ const startWorker = async (workerId) => {
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.set('trusted proxy', process.env.TRUSTED_PROXY_IP || 'loopback,uniquelocal');
|
app.set('trust proxy', process.env.TRUSTED_PROXY_IP ? process.env.TRUSTED_PROXY_IP.split(/(?:\s*,\s*|\s+)/) : 'loopback,uniquelocal');
|
||||||
|
|
||||||
const pgPool = new pg.Pool(Object.assign(pgConfigs[env], dbUrlToConfig(process.env.DATABASE_URL)));
|
const pgPool = new pg.Pool(Object.assign(pgConfigs[env], dbUrlToConfig(process.env.DATABASE_URL)));
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
|
Loading…
Reference in New Issue
Block a user