• 请不要在回答技术问题时复制粘贴 AI 生成的内容
longmeier90
V2EX  ›  程序员

nginx 配置的问题

  •  
  •   longmeier90 · Dec 11, 2020 · 950 views
    This topic created in 1985 days ago, the information mentioned may be changed or developed.

    我想实现 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;
      }
    

    }

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5276 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:45 · PVG 16:45 · LAX 01:45 · JFK 04:45
    ♥ Do have faith in what you're doing.