# Nginx reverse proxy issue

**URL:** <https://forum.rasa.com/t/nginx-reverse-proxy-issue/57334>\
**Category:** Rasa Open Source\
**Created:** [February 24, 2023, 9:38pm UTC](https://forum.rasa.com/t/nginx-reverse-proxy-issue/57334 "2023-02-24T21:38:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapory-brooklet-key](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vapory-brooklet-key](https://forum.rasa.com/u/vapory-brooklet-key)\
**Post date:** [February 24, 2023, 9:38pm UTC](https://forum.rasa.com/t/nginx-reverse-proxy-issue/57334/1 "2023-02-24T21:38:10Z")

</div>

Hello,

I’m not an nginx user, so my error could be basic, but I am looking for some help.

I have a VPS which I have spun up with the sole purpose of hosting a rasa server. Lets call it [chat.example.com](http://chat.example.com)

I have my normal website, and on one of the page, I want to call the chatbot. I do this using the rasa web widget. Lets call this [example.com](http://example.com)

If I set the websocket on [example.com](http://example.com) to [http://chat.example.com:5005](http://chat.example.com:5005), the widget works fine.

However, as this will be a production bot in future, I want the call on [example.com](http://example.com) to be to: [https://chat.example.com:5006](https://chat.example.com:5006)

(I’m using 5006, as 5005 is being used by rasa).

To this end, I’ve set up nginx using the following:

```auto
server {

  listen 5006 ssl;
  server_name chat.example.com; 
 

    ssl_certificate /etc/letsencrypt/live/[REDACTED]/fullchain.pem; # managed by Certbot 
    ssl_certificate_key /etc/letsencrypt/live/[REDACTED]/privkey.pem; # managed by Certbot

 
    location / {
        proxy_pass http://0.0.0.0:5005;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_redirect https://0.0.0.0:5006 http://0.0.0.0:5005;
    }

}

```

However, the calls aren’t making it to rasa server.

When I edit the underlying call to be to [http://chat.example.com:5005](http://chat.example.com:5005), it works fine so the server is running correctly. I think the issue is with nginx.

Can anyone help?

---

<div class="post-metadata">

**Author:** ![vapory-brooklet-key](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vapory-brooklet-key](https://forum.rasa.com/u/vapory-brooklet-key)\
**Post date:** [February 24, 2023, 10:12pm UTC](https://forum.rasa.com/t/nginx-reverse-proxy-issue/57334/2 "2023-02-24T22:12:48Z")

</div>

as usual - fastest way to solve your own issues us to ask for help in public.

When I altered the port to 5006, I forget to open that in the firewall. And spent the next two hours looking for an error in good code.

The above script seems to be good for what I am trying to do, but if this is wrong approach or if there is something I am missing, I’d love to hear it.

---

<div class="post-metadata">

**Author:** ![Ashermelon](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@Ashermelon](https://forum.rasa.com/u/Ashermelon)\
**Post date:** [December 22, 2023, 11:35am UTC](https://forum.rasa.com/t/nginx-reverse-proxy-issue/57334/3 "2023-12-22T11:35:32Z")

</div>

It seems like you’re encountering an Nginx reverse proxy issue while trying to set up your Rasa server. Your setup looks pretty close, but there might be a small configuration detail causing the problem. For those not familiar with Nginx, these issues can indeed be a bit tricky. If you’re still having trouble after checking your Nginx configuration, you might want to explore solutions to ensure smooth proxying. If you need reliable proxy services for various tasks, you can [Buy proxy](https://lightningproxies.net/). Quality proxies can be a valuable resource in troubleshooting issues like this and ensuring your server and applications work seamlessly.
