第一步,nginx.conf文件中配置
server {
listen 443 ssl;
server_name www.baidu.com;
root /usr/share/nginx/html;
ssl_certificate “/mnt/origins/214893483170515.pem”;
ssl_certificate_key “/mnt/origins/214893483170515.key”;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
location /gateway/ {
rewrite ^.+gateway/?(.*)$ /$1 break;
proxy_pass http://localhost:30027/;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 500m;
}
error_page 403 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
第二步
查看防火墙是否开启端口
firewall-cmd --list-ports:查看开放的端口
//添加443端口
firewall-cmd --zone=public --add-port=443/tcp --permanent