国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

python - nginx為什么不能反代圖片?

瀏覽:218日期:2022-08-25 18:26:23

問題描述

我的nginx配置

location ^~ /images/ {alias /home/honmaple/storage/images/;expires 1d; } location ~* ^/admin/(.*)/static/ {alias /home/honmaple/.virtualenvs/blog/lib/python3.4/site-packages/flask_admin/static/;access_log off;expires 1d; } location ~ ^/(api|admin)/ {proxy_pass http://127.0.0.1:8001;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; } location / {return 403; }

圖片路徑類似這樣 xxx.com/images/admin/thumb/2017/03/148941736894194.png

但是直接訪問url會變成xxx.com/images/admin/thumb/2017/03/148941736894194.png/,多了一個斜杠,并且報錯404, 查看日志,發現是這樣

2017/03/14 00:26:05 [error] 2288#2288: *15061 '/home/honmaple/storage/images/admin/thumb/2017/03/148941736894194.png/index.html' is not found (2: No such file or directory), client: 1.1.1.1, server: xxx.com, request: 'GET /images/admin/thumb/2017/03/148941736894194.png/ HTTP/1.1', host: 'xxx.com'

請教一下這是哪里的配置有問題

問題解答

回答1:

你的這里寫錯了吧,location ^~ /images/ 不應該是~ ^嗎

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 霍邱县| 平原县| 大港区| 江北区| 桂阳县| 泽库县| 金华市| 台湾省| 湘潭县| 高邑县| 宾川县| 邵阳县| 浏阳市| 湛江市| 邯郸县| 顺平县| 会泽县| 友谊县| 建德市| 建湖县| 八宿县| 金川县| 太和县| 吉首市| 通化县| 康保县| 成武县| 株洲市| 闽侯县| 铁力市| 芮城县| 资兴市| 乃东县| 大竹县| 高邮市| 额济纳旗| 怀来县| 永寿县| 遂溪县| 桦南县| 澄江县|