upstream backend {
server 192.168.42.1;
}
server {
listen 443 http2 ssl ;
server_name www.wiseessays.cn;
ssl_certificate /etc/letsencrypt/live/wiseessays.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wiseessays.cn/privkey.pem; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl_protocols TLSv1.2 TLSv1.3 TLSv1.1;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security "max-age=31536000";
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff" always;
rewrite ^/(.*)/$ /$1 permanent;
if ($request_uri ~* "\/\/") { rewrite ^/(.*) $scheme://$host/$1 permanent; }
#rewrite lowercase
location ~ [A-Z] {
set $temp 1;
#if ($request_uri ~ ((\.css(\?.+)?$)|(\.svg(\?.+)?$)|(\.js(\?.+)?$)|\/font\/|(\.jpg(\?.+)?$))) {set $temp 3;}
if ($request_uri ~ ((\.css(\?.+)?$)|(\.svg(\?.+)?$)|(\.js(\?.+)?$)|\/font\/|(\.jpg(\?.+)?$))) {add_header Cache-Control "public, no-transform";expires 7d;set $temp 3;}
if ($temp ~ 1) {
rewrite ^(.*)$ $scheme://$host$uri_lowercase;
}
}
location /assets/ {
root /var/www/;
try_files $uri $uri/ = router;
expires 7d;
access_log off;
log_not_found off;
}
location router {
proxy_pass http://backend;
proxy_set_header Host $host;
}
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffers 4 256k;
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
}
location /wp-admin { deny all; }
location ~ /\.ht { deny all;}
}
Trying 120.79.167.120...
* TCP_NODELAY set
* Connected to www.wiseessays.cn (120.79.167.120) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.wiseessays.cn:443
* Closing connection 0
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.wiseessays.cn:443
upstream backend {
server 192.168.42.1;
}
server {
listen 443 http2 ssl ;
server_name www.wiseessays.cn;
ssl_certificate /etc/letsencrypt/live/wiseessays.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wiseessays.cn/privkey.pem; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl_protocols TLSv1.2 TLSv1.3 TLSv1.1;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security "max-age=31536000";
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff" always;
rewrite ^/(.*)/$ /$1 permanent;
if ($request_uri ~* "\/\/") { rewrite ^/(.*) $scheme://$host/$1 permanent; }
#rewrite lowercase
location ~ [A-Z] {
set $temp 1;
#if ($request_uri ~ ((\.css(\?.+)?$)|(\.svg(\?.+)?$)|(\.js(\?.+)?$)|\/font\/|(\.jpg(\?.+)?$))) {set $temp 3;}
if ($request_uri ~ ((\.css(\?.+)?$)|(\.svg(\?.+)?$)|(\.js(\?.+)?$)|\/font\/|(\.jpg(\?.+)?$))) {add_header Cache-Control "public, no-transform";expires 7d;set $temp 3;}
if ($temp ~ 1) {
rewrite ^(.*)$ $scheme://$host$uri_lowercase;
}
}
location /assets/ {
root /var/www/;
try_files $uri $uri/ = router;
expires 7d;
access_log off;
log_not_found off;
}
location router {
proxy_pass http://backend;
proxy_set_header Host $host;
}
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffers 4 256k;
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
}
location /wp-admin { deny all; }
location ~ /\.ht { deny all;}
}