V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
longmeier90
V2EX  ›  程序员

nginx 配置的问题

  •  
  •   longmeier90 · 2020-12-11 15:21:26 +08:00 · 561 次点击
    这是一个创建于 1203 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想实现 tstwx.bolineyecare.com/2.jpeg, 访问的是我服务器 /home/data/wx-webview/checkin/dist 目录下的图片。 但是当我访问的时候图片显示不了,状态码 200,不知道我的问题出在哪里啦。

    server {

        listen       443;
        server_name  tstwx.bolineyecare.com;
        root /home/data/wx-webview/;
    
        location /checkin/{
              alias /home/data/wx-webview/checkin/dist/;
              #try_files $uri/ $uri/;
              autoindex on;
       }
       location / {
            try_files $uri $uri/ @router;
            index index.htm index.html;
      }
    
      location @router {
         add_header    Cache-Control no-store;
         rewrite ^.*$ /index.html last;
      }
      location /statics/ {
            # add_header    Cache-Control no-store;
            valid_referers none blocked *.bolineyecare.com;
            if ($invalid_referer) {
                return 403;
            }
           alias /data/statics/;
           expires 365d;
      }
      location /~\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt)$ {
           root /home/data/wx-webview/checkin/dist/;
           expires -1;
      }
    

    }

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3558 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:55 · PVG 12:55 · LAX 21:55 · JFK 00:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.