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;
}
}