Skip to main content

Add Nginx Server Rewrite

Comments

3 comments

  • Larry

    The way to do that would be with a rule in your web.locations block. There’s an example in the docs here:

    https://docs.platform.sh/configuration/app/web.html#how-can-i-rewrite-an-incoming-request-without-a-redirect

    0
  • Jeroen Versteeg

    Is there a way to rewrite URLs to static files as well?

    For example, I’d like to implement cache-busting by rewriting

    /path/file.hash.js => /path/file.js
    

    I tried the following, but kept getting 404:

    rules:
      '(?<file>.*)\.\w{8}\.js$':
        passthru: '/$file.js'
    
    0
  • Jason Di Benedetto

    @bao-tran did you work out how to achieve this on Platform.sh. We are also looking to set up Blitz caching.

    Any help would be greatly appreciated. Thanks.

    0

Please sign in to leave a comment.