Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
57cd6546
Commit
57cd6546
authored
7 years ago
by
Matt Jankowski
Committed by
Eugen
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make HSTS enable optional with force_ssl (#2364)
parent
1244630a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/environments/production.rb
+7
-4
7 additions, 4 deletions
config/environments/production.rb
with
7 additions
and
4 deletions
config/environments/production.rb
+
7
−
4
View file @
57cd6546
...
...
@@ -35,8 +35,13 @@ Rails.application.configure do
# Allow to specify public IP of reverse proxy if it's needed
config
.
action_dispatch
.
trusted_proxies
=
[
IPAddr
.
new
(
ENV
[
'TRUSTED_PROXY_IP'
])]
unless
ENV
[
'TRUSTED_PROXY_IP'
].
blank?
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config
.
force_ssl
=
false
# When LOCAL_HTTPS is set, force traffic over SSL
config
.
force_ssl
=
(
ENV
[
'LOCAL_HTTPS'
]
==
'true'
)
# When ENABLE_HSTS is also set, turn on Strict-Transport-Security
config
.
ssl_options
=
{
hsts:
(
ENV
[
'ENABLE_HSTS'
]
==
'true'
)
}
# By default, use the lowest log level to ensure availability of diagnostic information
# when problems arise.
...
...
@@ -108,8 +113,6 @@ Rails.application.configure do
config
.
action_mailer
.
delivery_method
=
ENV
.
fetch
(
'SMTP_DELIVERY_METHOD'
,
'smtp'
).
to_sym
config
.
force_ssl
=
(
ENV
[
'LOCAL_HTTPS'
]
==
'true'
)
config
.
react
.
variant
=
:production
config
.
to_prepare
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment