Configure nginx as reverse proxy for Octopus

Hi,

I am looking for some help with regards to configure nginx as reverse proxy for Octopus.

I have nginx installed on a linux server.

I have a tentacle setup on a windows server and the proxy settings are set to use the default proxy. Do I need to setup a custom proxy or will the default be enough.

I think the configuration file would look like so but not sure:

server {

listen 80;
location / {

proxy_pass https://octopus server address;

}

}

Kind Regards,
Micheál Power

Hi @mikepower79!

Depending on your tentacle configuration, and if you have a polling polling tentacles, you can achieve an NGINX reverse proxy with a relatively simple config, here’s a base template to get you started:

http {

    upstream backend {
        server server_ip1;
        server server_ip2;
        server server_ip3;
    }

    server {
        listen 80;

        location / {
            proxy_pass http://backend;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   Host      $http_host;
            proxy_http_version 1.1;
        }
    }
}

This should get you most of the way there, you will likely need to adjust settings depending on the details of your environment (if polling tentacles need to poll through the reverse proxy etc.)

I hope this helps!

Hi @Justin_Walsh ,
Would this be any different if it was a http proxy. I mentioned a reverse proxy in my original message. We dont want to configure a polling tnetacle and would like to get it working with a listening tentacle.
I have set up a listening tentacle in Octopus and a proxy in Octopus with proxy port 80.
I have updated the nginx.conf file in nginx on a linux server with the server IP, Port and location as you posted in your response.

Kind Regards,
Micheal Power

Hi @Justin_Walsh,
I have created a octopus.conf file in the /etc/nginx/sites-enabled folder.
With the following:

server {
    listen 80;
    location / {
          proxy_pass http://octopus url;
          proxy_set_header   X-Real-IP $remote_addr;
          proxy_set_header   Host      $http_host;
          proxy_http_version 1.1;
   }
}

Is there anything else I need to configure??
for the proxy_pass I am entering the octopus url, should I be entering another value.
Is there a part of the message that contains another variable that I should enter to proxy_pass??

Kind Regrads,
Micheál Power

Hi Mike -

That looks fine from cursory instpection - is something not working when trying to use the reverse proxy?

If you would like to elaborate on what you’re trying to achieve, ideally, then I can proabably give you some more specific advice.

Best,