项目基础部署汇总三(2)—Nginx配置ssl证书

项目基础部署汇总三(2)—Nginx配置ssl证书server {listen 80;server_name 域名;return 301 https://$server_name$request

大家好,欢迎来到IT知识分享网。

server {

listen 80;

server_name 域名;

return 301 https://$server_name$request_uri;

}

server {

listen 443 ssl;

server_name 域名;

ssl_stapling on;

ssl_stapling_verify on;

ssl_certificate_key /opt/data/nginx/域名/key.pem;

ssl_certificate /opt/data/nginx/域名/cert.pem;

ssl_session_timeout 5m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_ciphers 证书码;

ssl_prefer_server_ciphers on;

location ~ /MP_verify_(.*)\.txt {

return 200 “$1”;

}

nginx自带有配置,按照上面的改了,监听443端口就行,ssl证书要选择是nginx配置的,不能是tomcat配置的

# Settings for a TLS enabled server.

#

# server {

# listen 443 ssl http2 default_server;

# listen [::]:443 ssl http2 default_server;

# server_name _;

# root /usr/share/nginx/html;

#

# ssl_certificate “/etc/pki/nginx/server.crt”;

# ssl_certificate_key “/etc/pki/nginx/private/server.key”;

# ssl_session_cache shared:SSL:1m;

# ssl_session_timeout 10m;

# ssl_ciphers PROFILE=SYSTEM;

# ssl_prefer_server_ciphers on;

#

# # Load configuration files for the default server block.

# include /etc/nginx/default.d/*.conf;

#

# location / {

# }

#

# error_page 404 /404.html;

# location = /40x.html {

# }

#

# error_page 500 502 503 504 /50x.html;

# location = /50x.html {

# }

# }

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/54205.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信