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 #
2
Answers
Here's what I have discovered yesterday and ended up working for me.
Create this file:
This way you can override the default
/
block. Other solutions didn't work.Hope this helps me and other people in the future!
If your environment is based on a platform built on top of the AWS AMI 2 image, put your nginx config in this directory :
.platform/nginx/conf.d/rewrite.conf
More info here