r/nginx•
AsteriskTheServer

How do drop I a query parameter?

I have been trying to drop a query parameter that font-awesome has added to their CSS code. See this issue if you are interested.

An example of one of the current uris is:

/assets/fonts/fontawesome-webfont.woff?v=4.7.0

I am trying to get it to

/assets/fonts/fontawesome-webfont.woff

The location block I currently have is:

location /assets/fonts/fontawesome-webfont\.(?=eot|svg|ttf|woff2?) {
        rewrite ^$uri.*$ $uri? permanent;
  }

The uri I am receiving from this block is:
/:1

Also, do note that I am aware of this stackoverflow question but I don't want to specify the whole URL since I won't know what the scheme and what the host is.

I would appreciate if you pointed what is wrong about the location block I posted above so I can learn from this.

Posted Apr 26, 2017, 5:30 PM UTC

21
Loading comments…