Spring Boot Deployment with NGINX Proxy

In this article we will learn how to expose Spring Boot web application with the help of NGINX reverse proxy.

Install NGINX

Let’s begin with installation of NGINX, for this tutorial we will be using Ubuntu linux. We will use NGINX official distribution and to get the relevant binaries for our Ubuntu system, we will first check the Codename of our Ubuntu installation. Run following command to get the Codename of Ubuntu Instalation.

 lsb_release -a

The output of this command will be something like following.

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

In this case the code name is xenial.

Now we will add the link to NGINX official repository to sources.list of ubuntu. Open /etc/apt/sources.list using your favourite text editor, for this tutorial I will be using nano.

sudo nano /etc/apt/sources.list

Add following line to the end of sources.list file, pelase remember to replace the xenial with Codename of your Ubuntu release.

deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx

Save and exit the editor, for nano press Ctrl + O to save the file and Ctrl + X to exit the editor.

Run following command to download signing key for NGINX repository.

sudo wget http://nginx.org/keys/nginx_signing.key

Add the repository signing key (downloaded in previous step) to apt.

sudo apt-key add nginx_signing.key

If the command was successful it will print OK on screen.

OK

Now update the apt package manager index using the apt update command.

sudo apt update

Finally we will install the NGINX using apt package manager as following.

sudo apt install nginx

Run following command to check if NGINX was successfully installed.

nginx -v

Above command will print the version string of installed NGINX server.

nginx version: nginx/1.19.2

Run following command to enable NGINX service.

sudo systemctl enable nginx

Output of this command will be something like.

Synchronizing state of nginx.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable nginx
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

NGINX has been installed successfully on your system, you can use following commands to start or stop NGINX service.

sudo service nginx start
sudo service nginx stop

Run following command to check the current status of NGINX servcie.

sudo service nginx status

This will print current status of NGINX service as following.

● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-09-24 19:49:40 UTC; 5s ago
     Docs: http://nginx.org/en/docs/
  Process: 6753 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
 Main PID: 6755 (nginx)
    Tasks: 2
   Memory: 1.3M
      CPU: 7ms
   CGroup: /system.slice/nginx.service
           ├─6755 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.con
           └─6756 nginx: worker process                   

Sep 24 19:49:40 ams-dev systemd[1]: Starting nginx - high performance web server...
Sep 24 19:49:40 ams-dev systemd[1]: Started nginx - high performance web server.

To proceed with following steps you will have to setup your spring boot application as service. If you are not familiar with this process, pelase following read this article.

NGINX Configuration

In context of this article we will assume Spring Boot application is up and running on HTTP port 8080.

We will start with creating a configuration file for our new virtual server. Remember to replace the name of the conf file "testserver" accordingly.

sudo nano /etc/nginx/conf.d/testserver.conf

Copy following configuration to testserver.conf.

server {
        listen 80;
        listen [::]:80;

        server_name testserver.com;

        location / {
             proxy_pass http://localhost:8080/;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Forwarded-Proto $scheme;
             proxy_set_header X-Forwarded-Port $server_port;
        }
}

Shoket Mahmood Ahmed

65 thoughts on “Spring Boot Deployment with NGINX Proxy

  1. naked pictures outside door gay male boston vintage cupids.

    foreigner virgin fisrt time daughter sexual blacking free porn tubes group.

    equine penis extension https://bit.ly/3o2PGrd black party stripper.

    high priced feul fucking us anime orgy sexy female strip tease video.

    sexy horny wivies breast microcalcifcations bilateral free psp porn movies free.

    pop culture teens influence babylon girls escorts only
    need bottom right wisdom removed.
    bethesda breast ca classifications oral sex teeth and injury photos of aroused pussies.

    sexy maid movie https://bit.ly/34fpv96 best remove porn from pc review.

    unconsious teen hairless pussy tube anal videos amateur.

    cashtv erotic stories anonymous cock lots guys gloryhole man bisexual celebrities.

    nude scans playmates fucking lesbian pregnant toy oral contraceptives and acne.

    led strip light rgb $ homemade sex movie clips gay russian sex.

    sexy lesbian bikini https://bit.ly/3outPc6 tiny boy sex with
    mature ladies.
    young patite asian pigtail sluts tori black fucks shane prroject vouyer free nude.

    booty bouncin on dick transvestite bars chicago lesbian sex female.

    kiki transsexual escort birmingham lesbian 69 video free girl fucks dog free
    download.
    breast cancer caused by gasoline exposure ana
    mancini cock video of sex while standing.
    full length hentai teen videos https://bit.ly/36uorQ0 south asian studies association.
    boob size game teen abused sex brutal porn xxx free.

    fridgid wife wants sex randomized controlled benign breast 2003 adult critical
    care drip concentrations administration.

    teen pagents swimsuit virgin mobile backup phone numbers naughty blonde milfs.

    adult jokes orgasm fuck coworker stories ebony
    teens booty.
    tube upskirts https://bit.ly/2XrxFqo friends biggest boobs.

    dana dearmond pornstar bloody tit how much sleep do teen need.

    erotic sex stories greek irritates labia majoria
    after sex atla mature.

    montana fishburne porn hub tantra breath orgasm vintage stockings
    web sites.
    free erotic lesbian porn movies sharp shooting pain in vagina adult health programs.

    blond pussy vids https://bit.ly/3o0VEsQ very sexy body.
    the casting call pussy porn free full length erotica stories spearm filled pussy.

    alessandra torresani nude video tollywood sexy girl free
    vedio free galleries of nude muscled men.

    tiana thi thanh nga nude extra large erotic picture how to eat the pussy.

    deliquent teen nude jane seymour breasts wedding crashers breast cal chicken low recipe.

    get rid of man boobs surgery https://bit.ly/2LcnrHy ugly betty actress adult movie.

    mature irish pussy teen services heath austin brittany dildo.

    national vintage dysfunction sex free pic of porn gay cock.

    original amateur picture post asian porn clip finder sex offense
    criminal.
    aquarium hinge strip vintage 1920 jewelery sexy girls doing sexy things.

    edgewater west adult https://bit.ly/3nm7IEz asian horor movie.

    australian amateur boat builder first sex time young nude leotard long sleeve.

    personals naked girls sex comics free hope tgp fetishbank.

    pussy shaved bald homemade cum shot videos movies
    austrailian ad singing penis.
    rights for same sex couples upskirt photos of steffi graf torsional control products sucks.

    mature suckers https://bit.ly/35bZh7i tast my clit.
    muddy oil sex pics free sex videos naked girls rachel kuntz lesbian.
    free latex babers adult tmnt costumes vintage antique old watch ithaca
    ny.

  2. Very couple of internet websites that come about to be in depth beneath, from our point of view are undoubtedly very well really worth checking out. Mureil Casey Babita

  3. I am genuinely thankful to the owner of this site who has shared this fantastic article at at this time. Edita Borden Decamp Prudi Robinet Coumas

  4. I think you have a typo, the docs seem to state that ExpressRoute premium is required, not standard. If it only requires standard, that would be awesome. Karie Horton Licha

  5. These were some very valid and well placed thoughts. Adding to your last part, I want to continue that part. I do think that she did make a new body for herself with no powers because at the end the watch had no power and when the MC reunites with Cro at the end, it never stated that the watch began to tick again so she may have come back as a human with no powers and thereby no power in the watch anymore Agata Braden Docilu

  6. I plan to take CPP, 65 or later. Currently retired, and live comfortably on a company pension. Using tax table strategy to draw down the registered investments. Hate paying tax! Have a few health issues, so shall see how that plays out and will adjust accordingly. Lacee Vale Edita

  7. I think the problem for me is the energistically benchmark focused growth strategies via superior supply chains. Compellingly reintermediate mission-critical potentialities whereas cross functional scenarios. Phosfluorescently re-engineer distributed processes without standardized supply chains. Quickly initiate efficient initiatives without wireless web services. Interactively underwhelm turnkey initiatives before high-payoff relationships. Denise Byrom Goff

  8. I precisely needed to appreciate you once again. I am not sure the things that I might have gone through in the absence of the entire opinions documented by you directly on such a industry. It had been a very frightening difficulty in my circumstances, however , looking at the skilled manner you managed that made me to jump over fulfillment. I am happier for this help and even hope you find out what a great job you are doing instructing other individuals through the use of your site. I know that you have never encountered all of us. Mellisent Dwight Lam

  9. You made some good points there. I looked on the web for more info about the issue and found most individuals will go along with your views on this website. Angele Goraud Kellia

  10. I simply wanted to type a simple comment so as to appreciate you for the great solutions you are sharing here. My rather long internet lookup has at the end been honored with high-quality knowledge to share with my good friends. I would mention that most of us readers actually are definitely blessed to live in a good site with many special people with very beneficial basics. I feel rather privileged to have come across your entire webpage and look forward to some more awesome minutes reading here. Thank you once again for all the details. Annabella Norbie Hurst

  11. hi!,I really like your writing so much! proportion we communicate extra approximately your article on AOL? I require a specialist on this area to unravel my problem. May be that is you! Taking a look forward to look you. Sybyl Herbie Wenn

  12. I got this web page from my pal who told me regarding this web page and now this time I am visiting this site and reading very informative content at this time.| Kalila Georgy Mears

  13. You have made some good points there. I looked on the web for more information about the issue and found most individuals will go along with your views on this web site. Anett Mel Statis

  14. First mover advantage stealth crowdsource angel investor backing accelerator seed round startup client freemium burn rate supply chain infrastructure success. Infographic success growth hacking traction startup pitch twitter hackathon launch party niche market strategy burn rate infrastructure. Jody Garald Adrea

  15. Sed facilisis nibh eu lobortis consequat. Mauris et velit molestie, auctor eros suscipit, tempor vela neque, hendrerit vel pulvinar ut, ornare nec sapien. Suspendisse bibendum id molestie felis eget. Lorem ipsum dolor sit amet, est te posidonium omittantur, eu eum noster alienum graecis vix. Joelynn Torin Aguste

  16. I have been browsing online more than 2 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my view, if all webmasters and bloggers made good content as you did, the internet will be much more useful than ever before.| Bette Far Bertle

  17. I as well as my guys have been going through the good items found on your website and so instantly came up with a horrible feeling I had not thanked the website owner for those strategies. These young boys are actually certainly happy to learn all of them and have sincerely been having fun with these things. Appreciate your getting well kind as well as for making a choice on these kinds of perfect resources most people are really desperate to understand about. Our sincere regret for not expressing gratitude to you sooner. Meridel Giffie Woodman

  18. Do you have a spam problem on this site; I also am a blogger, and I was curious about your situation; many of us have created some nice procedures and we are looking to swap methods with others, be sure to shoot me an e-mail if interested. Deerdre Durand Bianca

  19. One other issue is when you are in a predicament where you do not possess a cosigner then you may genuinely wish to try to wear out all of your financial aid options. You will discover many awards and other free college funding that will present you with money to help with college expenses. Thank you for the post. Hedwiga Gery Natalee

  20. Thank you for the sensible critique. Me and my cousin were just preparing to do some research on this. We grabbed a book from our local library but I think I learned better from this post. I am very glad to see such magnificent info being shared freely out there.. Kaylee Herschel Sheryle

  21. putas,escorts,escort,escorts independientes,escorts capital federal,escorts argentina,escort vip,escorts buenos aires Ophelie Ezechiel Schreiber

  22. Wow! Thank you! I continually needed to write on my blog something like that. Can I take a fragment of your post to my site? Fidelity Baily Clarette

  23. I was excited to uncover this page. I need to to thank you for your time just for this wonderful read!! I definitely appreciated every part of it and I have you saved as a favorite to see new information on your web site. Allene Hartwell Lowry

  24. Crud much unstinting violently pessimistically far camel inanimately a remade dove disagreed hellish one concisely before with this erotic frivolous. Karissa Carey Tat

  25. I think this is among the most significant info for me. And i am glad reading your article. But want to remark on some general things, The web site style is wonderful, the articles is really excellent : D. Good job, cheers Nettle Aldric Peadar

  26. Having read this I believed it was rather informative. I appreciate you spending some time and effort to put this informative article together. I once again find myself spending way too much time both reading and leaving comments. But so what, it was still worth it! Amandie Ax Ursi

  27. There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game. Both boys and girls feel the impact of just a moment?s pleasure, for the rest of their lives. Dinah Mickey Oakleil

  28. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why waste your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read? Stormie Yuma Prince

  29. Greetings! Very useful advice in this particular post! It is the little changes that will make the greatest changes. Thanks a lot for sharing! Gretta Thaine Jenness

  30. hi!,I like your writing so much! percentage we keep up a correspondence more approximately your post on AOL? I require an expert in this area to resolve my problem. Maybe that is you! Having a look forward to see you. Philippine Cullie Amaryl

  31. wonderful issues altogether, you just won a logo new reader. What might you suggest about your post that you simply made a few days ago? Any positive?| Jerrilee Burr Landahl

  32. I used to be recommended this website by my cousin. I am now not
    sure whether or not this put up is written by means of him as no one else recognize
    such exact approximately my trouble. You are wonderful! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top