Configuring any CDN to deliver only one file no matter what url has been requested

后端 未结 9 1814
日久生厌
日久生厌 2021-02-01 22:29

I am currently working on a new project where the entire page should be implemented in HTML5/JS working against an API/JSON. Since the entire application should only consist of

9条回答
  •  梦毁少年i
    2021-02-01 22:40

    Nginx http server can do this like:

    location /{
        # serve a file
    }
    

    or you can customize your links like

    location /my_html{
         # serve html file
    }
    
    location /cdn/{
         # serve rest files
    }
    

    you can even check urls by regexps

    location ~ /cdn/.*\.js${
        # serve cdn
    }
    

提交回复
热议问题