# Lua Cors policy url rewrite

**URL:** <https://discourse.haproxy.org/t/lua-cors-policy-url-rewrite/7149>\
**Category:** Help!\
**Created:** [November 30, 2021, 3:18pm UTC](https://discourse.haproxy.org/t/lua-cors-policy-url-rewrite/7149 "2021-11-30T15:18:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![highlife](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@highlife](https://discourse.haproxy.org/u/highlife)\
**Post date:** [November 30, 2021, 3:18pm UTC](https://discourse.haproxy.org/t/lua-cors-policy-url-rewrite/7149/1 "2021-11-30T15:18:04Z")

</div>

Hello,

I have in my conf the lua module for the CORS policy it look like this.  
I use this [Enabling CORS in HAProxy - HAProxy Technologies](https://www.haproxy.com/fr/blog/enabling-cors-in-haproxy/)

```auto
global
    lua-load /etc/haproxy/cors.lua
...

defaults
    log global
    option httplog

frontend https_in
    mode http
    bind *:80 v4v6
    bind *:443 v4v6 ssl crt /etc/ssl/certs/cert.pem alpn h2,http/1.1
    acl http ssl_fc,not
    http-request redirect scheme https if http

    option forwardfor except 127.0.0.1
    http-request add-header X-Forwarded-Proto https
    # Remove a response header
    http-response del-header X-Powered-By

    ######## START CORS ########

    http-request lua.cors "*" "api.domain.com auth.domain.com" "*"
    http-response lua.cors

    ######### END CORS #########

```

If i activate the CORS module i don’t have the CORS policy error but one of my URL is rewrite in a GET call

**Before activating the module:**  
[https://api.domain.com/login\_check/](https://api.domain.com/login_check/)

**After with the module:**  
https://api.domain.comlogin\_check/  
missing slash

I don’t understand what is the reason why it remove it.

Thank you for your time and help,
