Skip to content

Commit 8e07831

Browse files
Merge pull request #1190 from ita-social-projects/feature/issue-1262
Update default.conf.template
2 parents f6fc708 + 6abf74a commit 8e07831

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

templates/default.conf.template

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,38 @@ server {
22
listen 80;
33
listen [::]:80;
44

5-
server_name $FRONTEND_SERVER_NAME;
5+
server_name $FRONTEND_SERVER_NAME www.$FRONTEND_SERVER_NAME;
6+
server_tokens off;
67

78
location /.well-known/acme-challenge/ {
89
root /var/www/certbot;
910
}
1011

11-
return 301 https://$FRONTEND_SERVER_NAME;
12+
13+
location / {
14+
return 301 https://$FRONTEND_SERVER_NAME$request_uri;
15+
}
1216
}
1317

1418
server {
1519
listen 80;
1620
listen [::]:80;
1721

18-
server_name $BACKEND_SERVER_NAME;
22+
server_name $BACKEND_SERVER_NAME www.$BACKEND_SERVER_NAME;
23+
server_tokens off;
24+
1925

2026
location /.well-known/acme-challenge/ {
2127
root /var/www/certbot;
2228
}
23-
24-
return 301 https://$BACKEND_SERVER_NAME;
29+
30+
31+
location / {
32+
return 301 https://$BACKEND_SERVER_NAME$request_uri;
33+
}
2534
}
2635

36+
2737
server {
2838
listen 443 ssl http2;
2939
server_name $FRONTEND_SERVER_NAME;
@@ -61,4 +71,4 @@ server {
6171
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
6272
proxy_set_header X-Forwarded-Proto $scheme;
6373
}
64-
}
74+
}

0 commit comments

Comments
 (0)