0

I have an Azure Ubuntu 18.04 server. On the server I installed Docker and Jenkins. I want to access Jenkins from my local machine via port 8080. However, I cannot access Jenkins with the public IP address. For this reason I installed NGINX to forward the request.

My current setup looks as follows:

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                              NAMES
130a16aa29c4        jenkinsci/blueocean   "/sbin/tini -- /usr/…"   5 hours ago         Up 2 seconds        0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp   jenkins-blueocean
177e47ae908f        docker:dind           "dockerd-entrypoint.…"   5 hours ago         Up 15 seconds       2375/tcp, 0.0.0.0:2376->2376/tcp                   jenkins-docker
1fa2d5ea5e53        nginx                 "/docker-entrypoint.…"   5 hours ago         Up 36 seconds       0.0.0.0:80->80/tcp                                 mynginx1

What needs to be done to access Jenkins from my local machine?

Alex_P
  • 183
  • 7

1 Answers1

0

I followed the valuable instructions from Juriy Bura Installing and Configuring NGINX on CentOS

In the NGINX container I created a jenkins.conf file with these parameters:

server {
  listen 80;
  listen [::]:80;
  server_name MY.SERVER.IP.ADDRESS;

  location / {
    proxy_pass "http://INTERNAL.I.P.ADDRESS:8080";
  }
  error_page 500 502 503 504 /50x.html;
  location = /50x.html {
    root /usr/share/nginx/html;
  }
}

The file is stored at location /etc/nginx/conf.d/jenkins.conf. In this location, any file with .conf will be read by nginx. You can create your custom file and add your own external and internal IP address.

Alex_P
  • 183
  • 7