Part 1 - Configure Nginx for Jenkins
Add a new A record for Jenkins with the ipv4 address of the server.
Add a new server block below the existing server blocks.
Sample server block looks like,
server {
server_name <domain-name for Jenkins>;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 80;
}
- Check nginx config via,
sudo nginx -t
- Restart nginx via,
sudo service nginx restart
- Check if everything worked fine by going to the URL in the browser. It should open the Jenkins UI.
Part 2 - Configure SSL for Jenkins
- Follow the instructions at Offical website of certbot.
Part 3 - Configure Nginx for Jenkins
sudo nano /etc/nginx/sites-available/default
- Edit file for Jenkins server block.
server {
# SSL Configuration
access_log /var/log/nginx/jenkins.access.log;
error_log /var/log/nginx/jenkins.error.log;
}
Top comments (0)