'Nginx reverse proxy config to subdomain

I am new to Nginx but I would like to configure a reverse proxy. I want invoice.example.com:800 to automatically redirect to invoice.example.com:4430.

For some reason it won't work. It also says that my port 800 is not open. Even when it's forwarded to the right internal ip-address.

My current config is:

server { 
   listen 800;
   server_name invoice.example.com
   location / {
   proxy_pass http://invoice.example.com:4430/;
   }
}

When I use:

nginx -t

It returns with no errors.

Does anyone have an idea of what's wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source