Nginx配置HTTPS

server {
    listen 80 default_server;
    server_name abc.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen              443 ssl;
    server_name         abc.com;
    ssl_certificate     /etc/nginx/ssl/device.crt;
    ssl_certificate_key /etc/nginx/ssl/device.key;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://localhost:8095;
   }
}

你可能感兴趣的:(Nginx配置HTTPS)