amazon web services – nginx block not getting triggered

I have this file:

.ebextensions/nginx/conf.d/rewrite.config

files:
  "/etc/nginx/conf.d/rewrite.config":
    mode: "000755"
    owner: root
    group: root
    content: |
      location / {
          error_log "Rewrite rule triggered for URL: $uri" info;
          rewrite ^([^#]*)%23(.*)$ $1#$2 permanent;
      }


When I deploy this to Elastic Beanstalk using eb deploy, then make requests to the web app, this part is not triggered.

Is the code above correct? What am I doing wrong?

Note: Purpose of code is to replace %23 with #

Read more here: Source link