Setup Jenkins with Nginx reverse proxy

Setting up jenkins is something pretty straight forward. But configuring with Nginx is not that easy. So in this post I'm trying to ease this up for you.

Before setting up jenkins I would recommend oracle java installation. So here how it begins.

Step 1
1.Download and install java.

 sudo wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""  

2.untar jdk and create JAVA_HOME in ~/.bashrc

Step 2
Jenkins setup
 wget -q -O - | sudo apt-key add -  
 sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'  
 sudo apt-get update  
 sudo apt-get install jenkins  

To start jenkins fire up following command.

 sudo /etc/init.d/jenkins start  

To check logs

 tail -f /var/log/jenkins/jenkins.log  

To check your jenkins is up and running.

Step 3
In order to config nginx with jenkins we have do some customization.
1. Stop jenkins

 sudo /etc/init.d/jenkins stop  

2. Open jenkins script and add --prefix=/jenkins into JENKINS_ARGS

 JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"  

3. Install nginx

 sudo aptitude -y install nginx  

4. Remove default config and add following configuration

 cd /etc/nginx/sites-available  
 sudo rm default ../sites-enabled/default  

 server {  
  listen     80;    # Listen on port 80 for IPv4 requests  
  location ~ "^/static/[0-9a-fA-F]{8}\/(.*)$" {  
   #rewrite all static files into requests to the root  
   #E.g /static/12345678/css/something.css will become /css/something.css  
   rewrite "^/static/[0-9a-fA-F]{8}\/(.*)" /$1 last;  
  location /userContent {  
     #have nginx handle all the static requests to the userContent folder files  
     #note : This is the $JENKINS_HOME dir  
     root /var/lib/jenkins/;  
     if (!-f $request_filename){  
       #this file does not exist, might be a directory or a /**view** url  
       rewrite (.*) /$1 last;  
     sendfile on;  
  location /jenkins {  
    sendfile off;  
    proxy_redirect   default;  
    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_max_temp_file_size 0;  
    #this is the maximum upload size  
    client_max_body_size    10m;  
    client_body_buffer_size  128k;  
    proxy_connect_timeout   90;  
    proxy_send_timeout     90;  
    proxy_read_timeout     90;  
    proxy_buffer_size     4k;  
    proxy_buffers       4 32k;  
    proxy_busy_buffers_size  64k;  
    proxy_temp_file_write_size 64k;  

5. http://<host>/jenkins


  1. Thanks for sharing informative article on java application development. Your post helped to understand the career in Java.
    Java Training in Chennai
    Dot Net Training in Chennai
    PHP Training in Chennai

  2. Wow! It was the best article , actually you have posted something new compared to others, because I read many articles related to this topic but I only get impressed with your post only, keep posting.
    SAP training center in chennai|SAP course chennai|SAP Training in Chennai|SAP Institutes in Chennai|SAP training in chennai

  3. Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me understand through this article. You have done a great job by sharing this content in here. Keep writing article like this.

    DOT NET Training in Chennai | Dot net training | Best DOT NET Training institute in Chennai

  4. Thanks of sharing this post…Python is the fastest growing language that helps to get your dream job in a developing area. It says every fundamental in a programming, so if you want to become an expertise in python get some training
    Python Training in Chennai|Python Training|SAS Training in Chennai|Angularjs training in chennai

  5. Nice post you have done here. I am really very happy to read this. This is a very informative topic that you are chosen. keep it upCustomer Support Page

  6. Thank you so much for sharing this wonderful article. From this i have earned more knowledge since I have been following your blog for a long time.

    CCNA Training in Chennai | CCNA Training Institute in Chennai | Best CCNA Training in Chennai

  7. Good site development service providing companies are not hard to find out. Starting from the field of professional site app projects development to designing services they use to offer every facility to its customers.

  8. WP EasyCart eCommerce module is a straightforward shopping basket module that introduces into new or existing WordPress online journals and sites. Get a full WordPress eCommerce Shopping Cart framework inside minutes! Offer retail items, advanced downloadable merchandise, blessing cards and that's only the tip of the iceberg! What's more, now with WordPress, the capable components are still simple to administrate!
    Wordpress Cart Shop

  9. in this site Multi-level ivr plugin Introduction The WordPress Multi Level IVR Plugin comes with complete IVR solution to fulfill all your personal,,click this site

  10. Useful Information
    one and only affiliate agency in south INDIA, earn money online from affiliate network in india


  11. useful information

    Online recruitment for bank jobs and government jobs and you can get Notification and application to apply online for bank jobs and govt jobs

  12. Useful information:
    General Awareness and Current Affairs with Latest Current Affairs Quiz, GK Updates, General Knowledge Last 6 Months Current Affairs, Placement Papers, Model Papers, Interview Questions @

  13. useful information

    Online recruitment for bank jobs and government jobs and you can get Notification and application to apply online for bank jobs and govt jobs

  14. Useful Information……
    Recruitment voice contains Daily GK Updates, Bank Recruitment, Government jobs, Bank jobs, Interview Tips, Banking News, GK Updates Bank Recruitment

  15. Nice Information:
    Telugu Cinema Contains Telugu Cinema News, Latest Movie Reviews, Actor, Actress, Movie Galleries And Many More Telugu Cinema News

  16. Helpful Information Provides Latest Telugu Movie Reviews , Telugu Political News and Other Latest Telugu Movie News

  17. Thanks for sharing this informative content that guided me to know the details about the training offered in different technology.
    Web Designing Course in Chennai | web designing training in chennai

  18. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    cloud computing training in chennai | cloud computing courses in chennai

  19. Helpful Information:

    Telugu Cinema Contains Telugu Cinema News, Telugu Movie Reviews and many more @

  20. Thanks of sharing this post…Java is the fastest growing language that helps to get your dream job in a best way, so if you wants to become a expertise in Java get some training on that language.

    Core JAVA Training in Chennai | JAVA Training in Chennai

  21. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Dot net training in Chennai | dot net course in Chennai

  22. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.

    cloud computing training in chennai|cloud computing training|Cloud Computing Courses

  23. Nice information for job seekers. Thanks for sharing the awesome information , i also recommend online Notification

  24. Very Good Information and i also recommend Freshers job way ; as they are leading sites provides job information

  25. Thanks , you are giving very important information for many job seekers. In my experience , i got job through Recruitment Voice and according to me it is also one of the best site.

  26. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
    Salesforce Training in Chennai|Salesforce Training|Salesforce Training institutes in Chennai

  27. Thanks a lot for sharing this article! Regards: sarkarinaukri

  28. Wp easy care e-commerce module is an honest purchasing basket module that introduces into new or present WordPress online journals and websites. get a full Word press e-commerce purchasing cart framework inner minutes! provide retail objects, advanced downloadable products, blessing cards and that is best the tip of the iceberg! what's greater, now with WordPress, the successful additives are nevertheless easy to administrate!
    thank for sharing
    for more information
    oracle fusion procurement online training
    oracle fusion procurement training


  29. Awesome article. It is so detailed and well formatted, i enjoyed reading it as well as get
    some new information too.

    Oracle Fusion HCM Training

  30. Hii...Welcome to this blog...Your posting is really very informative.Keep sharing these types of informative....

  31. Nice Information
    one and only A Digital Marketing Agency in INDIA affiliate network in india

  32. really you have shared very informative blog. it will be really helpful to many peoples. before i read this blog i didn't have any knowledge about this but now i got some knowledge.
    hadoop training in chennai

  33. your site is great to view sir
    thank you for the valluable information


  35. This is very educational content and written well for a change Microleaves. It's nice to see that some people still understand how to write a quality post!

  36. The Blog gave me idea to Setup Jenkins with Nginx reverse proxy my sincere thanks for sharing this post Please Continue to share this post
    Devops Training in Bangalore

  37. Thanks for taking time to share this post. It is really useful. Continue sharing more like this.
    Hadoop Training in Chennai

  38. It is a very nice article including a lot of viral content. I am going to share it on social media. Get the online crackers in chennai.

  39. Thanks for sharing such informative article. Know about Know about English to Tamil from techfizy.

  40. Hi !!!
    Good evening!!!
    You have provided a nice article on excellent information
    Rainbow training institute offers new standard format of oracle fusion HCM online training .And they are giving a very good online teaching

  41. A proxy is any product that backings the http proxy conventions. mexico vpn

  42. Useful information. i am looking SAP HANA Online Training with real time project.

  43. happy new year quotes in hindi

    advance happy new year 2018

    whatsapp new year dp

    happy new year 2018 wallpaper 3d

    new year jokes

    new year wishes for boyfriend

    happy new year wishes song
    this post is really informative, I want to share it with all of my friends. Please allow me to share it with my friends who will subscribe to your site.

  44. Useful information. i am looking for SAP HANA Online Training from professional expert.

  45. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

    oracle fusion financials training in hyderabad

  46. Awesome post……. your article is really informative and helpful for me and other bloggers too

    oracle fusion scm online training

  47. Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information.

    oracle fusion hcm online training

  48. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    oracle training in bangalore

  49. This comment has been removed by the author.

  50. Your firewall setting should be done YiFy in a way that will allow your VPN to flow unrestrictedly.

  51. Nice Information
    Get Exclusive Telugu Movie News Online Easily at, You can also read, Latest Telugu Cinema News [url= Telugu Movie News ][/url]

  52. Nice post keep do posting The Info was too good, for more information regarding the technology Click
    Amazon web Services Training
    Devops training
    Salesforce Training online in India

  53. This comment has been removed by the author.

  54. A it is really nice post and valuable sharing thinks.
    Best CCNA Training In Chennai

  55. Great blog, Its really give such wonderful information, that was very useful for me. Thanks for sharing with us.

    Dot Net Training in Chennai

  56. Useful Information :

    Looking for the Best [url= Digital Marketing Institute in Vijayawada ][/url] , We provide training on live projects, internship, Flexible Classes, Free Demo @

  57. Thank you for sharing such a nice and interesting blog and really very helpful article

    Oracle Fusion Financials Online Training