ssl监听端口的修改示例:
1.打开nginx配置文件,例如:“/etc/nginx.conf”。
2.在文件里的“http{}”声明内找到“listen”,后面就是当前监听的端口,修改配置文件,重启nginx服务即可,文
件内容如下:
server {
listen 443 ssl http2; //监听的端口
server_name 172.16.3.64; //可用的IP地址
root /var/www/html/;
index index.php index.html index.htm;
#charset koi8-r;
access_log /var/log/nginx/access_log;
error_log /var/log/nginx/error_log error;
# SSL/TLS configs
ssl on;
ssl_certificate server.pem;
ssl_certificate_key privkey.pem;
location / {
proxy_pass http://127.0.0.1:8111; //代理的目标地址
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}