server {
listen 443 ssl; #监听https 443时需加ssl
server_name ; #你的域名
ssl on;
ssl_certificate ; #证书路径
ssl_certificate_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;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8080; #代理地址
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 80;
server_name ; #你的域名
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8081; #代理地址
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
相关文章:
- Nginx+Tomcat实现https,监听非80/443端口 2021-10-01
- nginx 同一个端口同时 支持 http 和 https 2021-08-05
- nginx 80端口转发到443 2021-09-20
- nginx 80端口跳转到443 2021-08-02
- nginx 80端口强制转443 2022-12-23
- 网页浏览端口,https端口号是443,http端口号是80 2021-11-22