server {
listen 80 default;
return 404;
}
server {
listen 80;
server_name www.test.com;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name www.test.com;
ssl on;
ssl_certificate ../cert/1.pem;
ssl_certificate_key ../cert/2.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
if ($args ~* "redirect:") {
return 403;
}
if ($args ~* "action:") {
return 403;
}
if ($args ~* "redirectAction:") {
return 403;
}
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
expires off;
sendfile off;
proxy_pass http://www.test.com:8080;
}
}
阿里云ssl tomcat nginx https
最新推荐文章于 2024-12-30 11:54:04 发布