Moving from nginx to kong

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!

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.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ