# Redirection to perl fcgi application

**URL:** https://discourse.haproxy.org/t/redirection-to-perl-fcgi-application/7127
**Category:** Help!
**Created:** [November 23, 2021, 4:14pm UTC](https://discourse.haproxy.org/t/redirection-to-perl-fcgi-application/7127 "2021-11-23T16:14:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Meian](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@Meian](https://discourse.haproxy.org/u/Meian)
#### Post date: [November 23, 2021, 4:14pm UTC](https://discourse.haproxy.org/t/redirection-to-perl-fcgi-application/7127/1 "2021-11-23T16:14:18Z")

</div>

Hi,

I have a server (let’s call it “serverA”) where haproxy is installed to load balance an application (Jira).  
I have another server (“serverB”) where nginx is installed with spawn-fgi and runs Perl cgi applications.  
I need these 2 applications to run under the same URL.

So I add the following to the frontend :

```auto
    acl is_myperlapp path_beg /myperlapp
    use_backend myperlapp if is_myperlapp

```

And the following to the backend :

```auto
backend myperlapp 
    mode http
    option httpchk
    option forwardfor
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    balance roundrobin
    server serverb 10.253.17.21:80 maxconn 128

```

On serverB, nginx configuration is functional, so an URL like the following works well:

```auto
https://serverb/myperlapp/test.cgi

```

With this configuration, when I reach [https://server](https://server) **a** /myperlapp/test.cgi from a browser, it redirects to [https://server](https://server) **b** /myperlapp/test.cgi  
But I need to have this redirection transparent for user so it keeps [https://server](https://server) **a** /myperlapp/test.cgi in the browser URL.

How can we make that ?

Also, please note that I am new to haproxy, I don’t know if it’s possible to host perl fcgi scripts directly on the server running haproxy (serverA in my example above). I found some documentation online with php but not with perl. Is it possible and is there some documentation that I couldn’t find ?

Best Regards,  
Laurent
