File tree 6 files changed +54
-0
lines changed
6 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ split_clients "${request_id}" $upstream_host {
59
59
* <%= ENV['APP'].gsub(/^pix-[^-]+-/, "pix-api-") %> .<%= ENV['API_HOST_SUFFIX'] || 'scalingo.io' %> ;
60
60
}
61
61
62
+ #add a catch all on http port to forward to the convenient https
63
+ server {
64
+ listen 80 default_server;
65
+ server_name _;
66
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
67
+ return 301 https://$host$request_uri;
68
+ }
69
+
62
70
server {
63
71
access_log logs/access.log keyvalue;
64
72
server_name localhost;
@@ -119,6 +127,7 @@ server {
119
127
add_header X-Content-Type-Options "nosniff";
120
128
add_header X-Frame-Options "SAMEORIGIN";
121
129
add_header X-XSS-Protection 1;
130
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
122
131
123
132
<% ENV.each do |key,value|
124
133
if key.start_with? 'ADD_HTTP_HEADER' %>
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ split_clients "${request_id}" $upstream_host {
59
59
* <%= ENV['APP'].gsub(/^pix-[^-]+-/, "pix-api-") %> .<%= ENV['API_HOST_SUFFIX'] || 'scalingo.io' %> ;
60
60
}
61
61
62
+ #add a catch all on http port to forward to the convenient https
63
+ server {
64
+ listen 80 default_server;
65
+ server_name _;
66
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
67
+ return 301 https://$host$request_uri;
68
+ }
69
+
62
70
server {
63
71
access_log logs/access.log keyvalue;
64
72
server_name localhost;
@@ -136,6 +144,7 @@ server {
136
144
add_header X-Content-Type-Options "nosniff";
137
145
add_header X-Frame-Options "SAMEORIGIN";
138
146
add_header X-XSS-Protection 1;
147
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
139
148
140
149
<% ENV.each do |key,value|
141
150
if key.start_with? 'ADD_HTTP_HEADER' %>
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ upstream api {
36
36
server <%= ENV['APP'].gsub(/^pix-[^-]+-/, "pix-api-") %> .<%= ENV['API_HOST_SUFFIX'] || 'scalingo.io' %> :443 max_fails=<%= ENV['NGINX_UPSTREAM_MAX_FAILS'] || 3 %> fail_timeout=<%= ENV['NGINX_UPSTREAM_FAIL_TIMEOUT'] || '5s' %> ;
37
37
}
38
38
39
+ #add a catch all on http port to forward to the convenient https
40
+ server {
41
+ listen 80 default_server;
42
+ server_name _;
43
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
44
+ return 301 https://$host$request_uri;
45
+ }
46
+
39
47
server {
40
48
access_log logs/access.log keyvalue;
41
49
server_name localhost;
@@ -114,6 +122,7 @@ server {
114
122
add_header X-Content-Type-Options "nosniff";
115
123
add_header X-Frame-Options "SAMEORIGIN";
116
124
add_header X-XSS-Protection 1;
125
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
117
126
118
127
<% ENV.each do |key,value|
119
128
if key.start_with? 'ADD_HTTP_HEADER' %>
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ split_clients "${request_id}" $upstream_host {
59
59
* <%= ENV['APP'].gsub(/^pix-[^-]+-/, "pix-api-") %> .<%= ENV['API_HOST_SUFFIX'] || 'scalingo.io' %> ;
60
60
}
61
61
62
+ #add a catch all on http port to forward to the convenient https
63
+ server {
64
+ listen 80 default_server;
65
+ server_name _;
66
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
67
+ return 301 https://$host$request_uri;
68
+ }
69
+
62
70
server {
63
71
access_log logs/access.log keyvalue;
64
72
server_name localhost;
@@ -143,6 +151,7 @@ server {
143
151
add_header X-Content-Type-Options "nosniff";
144
152
add_header X-Frame-Options "SAMEORIGIN";
145
153
add_header X-XSS-Protection 1;
154
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
146
155
147
156
<% ENV.each do |key,value|
148
157
if key.start_with? 'ADD_HTTP_HEADER' %>
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ split_clients "${request_id}" $upstream_host {
59
59
* <%= ENV['APP'].gsub(/^pix-[^-]+-/, "pix-api-") %> .<%= ENV['API_HOST_SUFFIX'] || 'scalingo.io' %> ;
60
60
}
61
61
62
+ #add a catch all on http port to forward to the convenient https
63
+ server {
64
+ listen 80 default_server;
65
+ server_name _;
66
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
67
+ return 301 https://$host$request_uri;
68
+ }
69
+
62
70
server {
63
71
access_log logs/access.log keyvalue;
64
72
server_name localhost;
@@ -136,6 +144,7 @@ server {
136
144
add_header X-Content-Type-Options "nosniff";
137
145
add_header X-Frame-Options "SAMEORIGIN";
138
146
add_header X-XSS-Protection 1;
147
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
139
148
140
149
<% ENV.each do |key,value|
141
150
if key.start_with? 'ADD_HTTP_HEADER' %>
Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ log_format keyvalue
16
16
# as we are about to override it in the server directive here below
17
17
access_log off;
18
18
19
+ #add a catch all on http port to forward to the convenient https
20
+ server {
21
+ listen 80 default_server;
22
+ server_name _;
23
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
24
+ return 301 https://$host$request_uri;
25
+ }
26
+
19
27
server {
20
28
access_log logs/access.log keyvalue;
21
29
server_name localhost;
@@ -39,6 +47,7 @@ server {
39
47
add_header X-Content-Type-Options "nosniff";
40
48
add_header X-Frame-Options "SAMEORIGIN";
41
49
add_header X-XSS-Protection 1;
50
+ add_header Strict-Transport-Security "max-age=31536001; includeSubDomains; preload";
42
51
43
52
<% ENV . each do |key , value |
44
53
if key . start_with? 'ADD_HTTP_HEADER' %>
You can’t perform that action at this time.
0 commit comments