Skip to content

Commit 505b74f

Browse files
authored
tls 1.3 fixes (#58)
1 parent c080c4d commit 505b74f

File tree

2 files changed

+136
-1
lines changed

2 files changed

+136
-1
lines changed

static/nginx.conf

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
user www-data;
2+
worker_processes 2;
3+
pid /run/nginx.pid;
4+
include /etc/nginx/modules-enabled/*.conf;
5+
6+
worker_rlimit_nofile 10240;
7+
8+
events {
9+
worker_connections 10240;
10+
multi_accept on;
11+
use epoll;
12+
}
13+
14+
http {
15+
16+
# GEO IP BLOCK DOMAIN
17+
geoip_country /usr/share/GeoIP/GeoIP.dat;
18+
map $geoip_country_code $allowed_country {
19+
default yes;
20+
CN no; #China
21+
# RU no; #Russia
22+
# HK no; #Hong Kong
23+
# IN no; #India
24+
# IR no; #Iran
25+
# VN no; #Vietnam
26+
# TR no; #Turkey
27+
# EG no; #Egypt
28+
# MX no; #Mexico
29+
# JP no; #Japan
30+
# KR no; #South Korea
31+
# KP no; #North Korea :)
32+
# PE no; #Peru
33+
# BR no; #Brazil
34+
# UA no; #Ukraine
35+
# ID no; #Indonesia
36+
# TH no; #Thailand
37+
}
38+
39+
# To activate GEO BLOCK, add this in the default conf:
40+
# COUNTRY GEO BLOCK
41+
# if ($allowed_country = no) {
42+
# return 444;
43+
# }
44+
45+
46+
##
47+
# Basic Settings
48+
##
49+
50+
sendfile on;
51+
tcp_nopush on;
52+
tcp_nodelay on;
53+
keepalive_timeout 65;
54+
types_hash_max_size 2048;
55+
server_tokens off;
56+
client_body_timeout 10;
57+
client_header_timeout 10;
58+
client_header_buffer_size 128;
59+
60+
# server_names_hash_bucket_size 64;
61+
# server_name_in_redirect off;
62+
63+
include /etc/nginx/mime.types;
64+
default_type application/octet-stream;
65+
66+
##
67+
# SSL Settings
68+
##
69+
70+
ssl_early_data on;
71+
ssl_protocols TLSv1.2 TLSv1.3;
72+
ssl_ciphers TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
73+
ssl_prefer_server_ciphers on;
74+
75+
76+
77+
##
78+
# Logging Settings
79+
##
80+
81+
access_log /var/log/nginx/access.log;
82+
error_log /var/log/nginx/error.log;
83+
84+
##
85+
# Gzip Settings
86+
##
87+
88+
gzip on;
89+
gzip_disable "msie6";
90+
91+
# gzip_vary on;
92+
# gzip_proxied any;
93+
# gzip_comp_level 6;
94+
gzip_buffers 16 8k;
95+
# gzip_http_version 1.1;
96+
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
97+
98+
##
99+
# Virtual Host Configs
100+
##
101+
102+
include /etc/nginx/conf.d/*.conf;
103+
include /etc/nginx/sites-enabled/*;
104+
}
105+
106+
107+
#mail {
108+
# # See sample authentication script at:
109+
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
110+
#
111+
# # auth_http localhost/auth.php;
112+
# # pop3_capabilities "TOP" "USER";
113+
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
114+
#
115+
# server {
116+
# listen localhost:110;
117+
# protocol pop3;
118+
# proxy on;
119+
# }
120+
#
121+
# server {
122+
# listen localhost:143;
123+
# protocol imap;
124+
# proxy on;
125+
# }
126+
#}

wordpress_install.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ fi
113113
# Update system
114114
apt update -q4 & spinner_loading
115115

116+
# Install dependencies for GEO-block in Nginx
117+
install_if_not geoip-database
118+
install_if_not libgeoip1
119+
116120
# Write MARIADB pass to file and keep it safe
117121
{
118122
echo "[client]"
@@ -165,12 +169,17 @@ run_static_script new_etc_mycnf
165169
apt install open-vm-tools -y
166170

167171
# Install Nginx
172+
check_command yes | add-apt-repository ppa:nginx/stable
168173
apt update -q4 && spinner_loading
169-
check_command apt install nginx -y
174+
install_if_not nginx
170175
sudo systemctl stop nginx.service
171176
sudo systemctl start nginx.service
172177
sudo systemctl enable nginx.service
173178

179+
# Download TLSv 1.3 modified nginx.conf
180+
rm -f /etc/nginx/nginx.conf
181+
check_command wget -q $STATIC/nginx.conf -P /etc/nginx/
182+
174183
# Install PHP 7.2
175184
apt install -y \
176185
php \

0 commit comments

Comments
 (0)