诠释小丑

harbor
关注
89404 号成员,2022-09-01 16:58:50 加入
85
个人主页 浏览
1h17m
在线时长
  • 图片不能显示

    2022-10-16 16:53

    解决了,谢谢

    之前 nginx 的图片配置:

    server {
        server_name images.5212345.cn;
        listen 80;
            location / {
                    root /data/images;
            }
    
    }
    
    

    今天突然想到是不是因为用了 http 的问题,所以加了一段

    server {
            server_name  images.5212345.cn;
            location / {
                    proxy_set_header Host $host;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header  X-Real-IP $remote_addr;
                    client_max_body_size  10m;
                    proxy_pass http://images.5212345.cn;
            }
    
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/5212345.cn/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/5212345.cn/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
    
    
    }
    
    

    现在图片可以正常显示了

    虽然可以显示了,但是我还是没有搞清楚,我访问的还是 http 的连接,确实可以访问了

    image.png

  • 图片不能显示

    2022-10-16 16:35

    image.png

    不是反盗链,都是自己的地址。没有设置反盗链,是不是我哪里设置的不对