Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
b6467715
Commit
b6467715
authored
May 14, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redirect all HTTP to HTTPS and enable HSTS, closes #18
parent
091a58ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
19 deletions
+6
-19
nginx-ssl.conf
conf/nginx-ssl.conf
+2
-2
nginx.conf
conf/nginx.conf
+4
-17
No files found.
conf/nginx-ssl.conf
View file @
b6467715
...
...
@@ -7,7 +7,7 @@
#ssl_certificate_key /path/to/my-private-decrypted.key;
# optional: tell browsers to require SSL (warning: difficult to change your mind)
#
add_header Strict-Transport-Security max-age=31536000;
add_header
Strict
-
Transport
-
Security
max
-
age
=
31536000
;
# optional: prefer certain ciphersuites, to enforce Perfect Forward Secrecy and avoid known vulnerabilities.
# done in consultation with:
...
...
conf/nginx.conf
View file @
b6467715
# The HTTP (not SSL) server.
# Redirect all HTTP to HTTPS.
server
{
listen
80
;
listen
[::]:80
default_server
ipv6only=on
;
server_name
$PUBLIC_HOSTNAME
;
# We'll expose this directory publicly over http.
root
$STORAGE_ROOT
/www/static
;
index
index.html
index.htm
;
location
/
{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files
$uri
$uri
/
/index.html
;
}
# Convenience redirect to https.
rewrite
^/mail(/.*)?
$
https://
$PUBLIC_HOSTNAME
/mail
$1
permanent
;
root
/tmp/invalid-path-nothing-here
;
rewrite
^/(.*)
$
https://
$PUBLIC_HOSTNAME
/
$1
permanent
;
}
# The secure HTTPS server.
...
...
@@ -31,9 +19,8 @@ server {
ssl_certificate_key
$STORAGE_ROOT
/ssl/ssl_private_key.pem
;
include
/etc/nginx/nginx-ssl.conf
;
#
We'll expose the same static directory under http
s.
#
Expose this directory as static file
s.
root
$STORAGE_ROOT
/www/static
;
index
index.html
index.htm
;
# Roundcube Webmail configuration.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment