V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
rivercherdeeeeee
V2EX  ›  程序员

只访问特定的资源目录

  •  
  •   rivercherdeeeeee · Oct 8, 2023 · 1582 views
    This topic created in 938 days ago, the information mentioned may be changed or developed.
    PHP 做的一个网站,网站已经迁移到 shopify 上了,vps 上网站的所有代码和文件资源都没动,现在打算 shopify 上网站的图片还是用先前 vps 服务器上的图片资源,所以现在想配一个二级域名,比如,source.test.com 指向原来 vps 上的项目文件,但这个 source.test.com 只给访问原先 vps 上网站特定的图片资源,比如 https://source.test.com/themes/default-bootstrap/img/compare/new-and-improved.png 浏览打开 source.test.com 时则只显示 ok ,这种需求该如何实现
    3 replies    2023-10-08 17:17:11 +08:00
    retanoj
        1
    retanoj  
       Oct 8, 2023
    vps 上 nginx 配置个
    server {

    server_name source.test.com;

    location /themes {} 指向图片目录
    location / { return 200 "ok"; }

    }
    rivercherdeeeeee
        2
    rivercherdeeeeee  
    OP
       Oct 8, 2023
    @retanoj .htaccess 里面该如何配置呀
    cpyun
        3
    cpyun  
       Oct 8, 2023
    @rivercherdeeeeee .htaccess 就用 apache 的反向代理进行配置
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1087 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 23:56 · PVG 07:56 · LAX 16:56 · JFK 19:56
    ♥ Do have faith in what you're doing.