# Moving from nginx to kong

**URL:** https://discuss.konghq.com/t/moving-from-nginx-to-kong/7679
**Category:** Questions
**Created:** [January 5, 2021, 7:22am UTC](https://discuss.konghq.com/t/moving-from-nginx-to-kong/7679 "2021-01-05T07:22:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jean-pierre](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jean-pierre](https://discuss.konghq.com/u/jean-pierre)
#### Post date: [January 5, 2021, 7:22am UTC](https://discuss.konghq.com/t/moving-from-nginx-to-kong/7679/1 "2021-01-05T07:22:51Z")

</div>

Hi all,

I’m using NGINX as a reverse proxy in front of my openstack servers. I’m using rewrite and sub-filter commands to modify URI and response bodies.

Now, if I want to use KONG instead, what is the best solution to configure KONG ?  
Is there a way to convert my NGINX config to KONG config ?  
Or do I have to use plugins to modify the response bodies ?  
If so, do I have to write my own plugins or are there existing plugins that do it?

Here is an example/extract of my NGINX config:

server {  
listen 80;  
server\_name 192.168.150.59;

```
location /Pop1/ComputeLegacy {
        rewrite ^/Pop1/ComputeLegacy(.*) /$1 break;
        proxy_pass https://192.168.150.91:8774;
        sub_filter 'https://192.168.150.91:8774' 'http://192.168.150.59/Pop1/ComputeLegacy';
        sub_filter_types *;
        sub_filter_once off;
        sub_filter_last_modified on;
        proxy_redirect off;
}
location /Pop1/Image {
        rewrite ^/Pop1/Image(.*) /$1 break;
        proxy_pass https://192.168.150.91:9292;
        sub_filter 'https://192.168.150.91:9292' 'http://192.168.150.59/Pop1/Image';
        sub_filter_types *;
        sub_filter_once off;
        sub_filter_last_modified on;
        proxy_redirect off;
}

```

…  
}

Thanks for your help!

---

<div class="post-metadata">

### Author: ![jathanshupe](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jathanshupe/32/2361_2.png) [@jathanshupe](https://discuss.konghq.com/u/jathanshupe)
#### Post date: [January 10, 2021, 12:54am UTC](https://discuss.konghq.com/t/moving-from-nginx-to-kong/7679/2 "2021-01-10T00:54:54Z")

</div>

Kong does support custom Nginx configs. There should be a snippet in the documentation about how to do so.

In addition, just using Kong itself, you’d define your proxy pass endpoints as Kong services. Then define a route for each, with the matching URI (location from your nginx config) as the path. To perverse the URI, just include the preserve\_path and set to true.

If you need further URI manipulations, there are plenty of plugins to do so as well.
