{"id":10136,"date":"2017-01-30T12:38:45","date_gmt":"2017-01-30T12:38:45","guid":{"rendered":"http:\/\/mobisoftinfotech.com\/resources\/?p=10136"},"modified":"2025-10-06T14:42:59","modified_gmt":"2025-10-06T09:12:59","slug":"setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","status":"publish","type":"post","link":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","title":{"rendered":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2"},"content":{"rendered":"<p>To setup nginx as reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is a server that is between a user and the web or app server. It is typically used to load balance the traffic to multiple app server.<\/p>\n<p>For this tutorial we are going to put apache tomcat server behind the nginx server. Here, we have already created a ubuntu 16.04 server at (52.55.150.107) IP address. I have setup tomcat on that server using the instructions given in <a href=\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/set-apache-tomcat-based-jee-server-using-ubuntu-16-04-ec2-either-open-jdk-oracle-jdk\" target=\"_blank\" rel=\"noopener noreferrer\">\u2018Setting up a Java server\u2019<\/a> tutorial. I have setup JDK8 and tomcat 8.5.<\/p>\n<p>Let\u2019s get started<\/p>\n<p><strong>Step 1: Fulfilling The Requirement Of Ports 80 And 8080<\/strong><\/p>\n<p>As we are going to use web server and tomcat in addition to regular SSH port 22, we are going to need ports 80 and 8080. For that let\u2019s go to \u2018ic2\u2019 management console.<\/p>\n<p>In the description of our instance, you can see the security group is \u2018Nignx\u2019.<\/p>\n<ul>\n<li>Under \u2018Network and Security\u2019<\/li>\n<li>Go to \u2018Security Group\u2019 and select \u2018Nignx\u2019<\/li>\n<li>Go to \u2018Inbound Port\u2019 and click on \u2018Edit\u2019<\/li>\n<li>Click on \u2018Add Rule\u2019 and select \u2018HTTP\u2019<\/li>\n<li>Again click on \u2018Add Rule\u2019 and now select \u2018Custom TCP Rule&#8217;<\/li>\n<li>In the \u2018Port Range\u2019 of \u2018Custom TCP Rule\u2019 add \u20188080\u2019<\/li>\n<li>Click on \u2018Save\u2019<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> <em>Here for both, HTTP and Custom TCP Rule, we are going to allow traffic from anywhere.<\/em><\/p>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10138\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/edit-inbound-rules-mobisoft-infotech-1.png\" alt=\"edit inbound rules mobisoft infotech\" width=\"745\" height=\"417\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10138 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20745%20417%22%3E%3C%2Fsvg%3E\" alt=\"edit inbound rules mobisoft infotech\" width=\"745\" height=\"417\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/edit-inbound-rules-mobisoft-infotech-1.png\"><\/p>\n<p><strong>Step 2: Check If Tomcat Is Accessible From The Internet<\/strong><\/p>\n<p>Now since port 8080 is open, we will try to access tomcat. Try to access: <a href=\"http:\/\/52.55.150.107:8080\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/52.55.150.107:8080\/<\/a><\/p>\n<ul>\n<li>as you can see in the below image that it is working.<\/li>\n<\/ul>\n<p>Now, our security group is set.<\/p>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10139\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Check-The-Access-Of-Tomcat-In-Search-Engine-mobisoft-infotech.png\" alt=\"check the access of tomcat in search engine mobisoft infotech\" width=\"745\" height=\"423\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10139 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20745%20423%22%3E%3C%2Fsvg%3E\" alt=\"check the access of tomcat in search engine mobisoft infotech\" width=\"745\" height=\"423\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Check-The-Access-Of-Tomcat-In-Search-Engine-mobisoft-infotech.png\"><\/p>\n<p><strong>Step 3: Setting Up Nginx<\/strong><\/p>\n<p>Command for this is<\/p>\n<pre style=\"background-color: #f3f3f7;\">$ sudo apt-get install -y nginx\n<\/pre>\n<p><strong>Note:<\/strong> <em>Here \u2018-y\u2019 means that you are sure that you want to install, so the installation will not prompt you once again<\/em><\/p>\n<p>To check the status for nginx you can use the command:<\/p>\n<pre style=\"background-color: #f3f3f7;\">$ sudo systemctl status nginx \n<\/pre>\n<p>If it\u2019s running you can go for a final check<br>\nSince it runs on <strong>port 80<\/strong>, you do not need to specify port in your IP address<br>\nFor example, I tried to access: <a href=\"http:\/\/52.55.150.107\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/52.55.150.107\/<\/a>. If it shows <strong>\u2018Welcome to nginx!\u2019<\/strong> this means that nginx is running<\/p>\n<p><strong>Note:<\/strong> <em>By default, nginx server configuration is stored in <strong>\u2018etc\/nginx\u2019<\/strong> and the main file is <strong>nginx.conf<\/strong>. Whereas, each of the sites that we enable is available in <strong>\u2018sites-available\u2019<\/strong>.<\/em><\/p>\n<p>It is not necessary to enable all the sites that are available, you can enable and disable some sites that you are serving using nginx. So the sites which are enabled they get symlinked in the sites-enabled.<\/p>\n<p><strong>Step 4: Look At All The Sites That Are Available And Enabled<\/strong><\/p>\n<ul>\n<li>For this use the command:<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">$ cd \/etc\/nginx\n<\/pre>\n<ul>\n<li>You can see the nginx.conf, and the sites that are available and sites that are enabled<\/li>\n<li>You can also see the number of sites that are available and enabled, for this use<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">$ ls -la sites-available\/\n<\/pre>\n<ul>\n<li>Here, there is only one site as default and to check if it is enabled<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">$ ls -la sites-enabled\/\n<\/pre>\n<ul>\n<li>And you will see default site is enabled.<\/li>\n<\/ul>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10141\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Look-At-All-The-Sites-That-Are-Available-And-Enabled-mobisoft-infotech.png\" alt=\"look at all the sites that are available and enabled mobisoft infotech\" width=\"745\" height=\"416\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10141 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20745%20416%22%3E%3C%2Fsvg%3E\" alt=\"look at all the sites that are available and enabled mobisoft infotech\" width=\"745\" height=\"416\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Look-At-All-The-Sites-That-Are-Available-And-Enabled-mobisoft-infotech.png\"><\/p>\n<p><strong>Note:<\/strong> <em>Here we are not going to do multiple site setup so this default configuration is sufficient for us.<\/em><\/p>\n<p><strong>Step 5: Editing Nginx Configuration<\/strong><\/p>\n<ul>\n<li>To edit nginx configuration run the following command:<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">$ sudo vi \/etc\/nginx\/sites-available\/default  \n<\/pre>\n<p><strong>Step 6: Adding Upstream Section And Using Proxypass Setting To Pass The Traffic<\/strong><\/p>\n<p>Now we need to add upstream section where we define our backend. Later we will use proxypass setting to pass the traffic that is coming to port 80 to the tomcat running on the localhost at port 8080.<\/p>\n<p><strong>Note:<\/strong> <em> It is not necessary for the tomcat to be running on the same server. In Fact, in production setup where you have multiple tomcats, you will be running tomcats and nginx instances on different servers, in that case you will need to add the IP address or cname for the tomcat servers that are running. <\/em><\/p>\n<ul>\n<li>You can have multiple server lines in order to specify multiple servers<\/li>\n<li>Add the following just before the server line:<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">upstream backend {\n        server 127.0.0.1:8080;\n        }\n<\/pre>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10142\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Adding-Upstream-Section-And-Using-Proxypass-Setting-To-Pass-The-Traffic-mobisoft-infotech.png\" alt=\"adding upstream section and using proxypass setting to pass the traffic mobisoft infotech\" width=\"745\" height=\"447\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10142 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20745%20447%22%3E%3C%2Fsvg%3E\" alt=\"adding upstream section and using proxypass setting to pass the traffic mobisoft infotech\" width=\"745\" height=\"447\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Adding-Upstream-Section-And-Using-Proxypass-Setting-To-Pass-The-Traffic-mobisoft-infotech.png\"><\/p>\n<p><em>Now we need to add proxy header to the server block. For this copy the following and add it the server block:<\/em><\/p>\n<pre style=\"background-color: #f3f3f7;\">proxy_set_header X-Real-IP $remote_addr;\nproxy_set_header Host $host;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_set_header X-Forwarded-Proto $scheme;\n<\/pre>\n<p><strong>Step 7: Modifying Location Block And Adding Proxypass Setting<\/strong><\/p>\n<ul>\n<li>Copy the below given command and add it in the server under location, as given in the below image<\/li>\n<\/ul>\n<pre style=\"background-color: #f3f3f7;\">{\n     \tproxy_pass http:\/\/backend;\n     }\n<\/pre>\n<p>That\u2019s all, this is the only setup that is required<\/p>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10143\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Modifying-Location-Block-And-Adding-Proxypass-Setting.png\" alt=\"Modifying Location Block And Adding Proxypass Setting mobisoft infotech\" width=\"745\" height=\"449\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-10143 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20745%20449%22%3E%3C%2Fsvg%3E\" alt=\"Modifying Location Block And Adding Proxypass Setting mobisoft infotech\" width=\"745\" height=\"449\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Modifying-Location-Block-And-Adding-Proxypass-Setting.png\"><\/p>\n<p><strong>Step 8: Stopping And Starting Nginx<\/strong><\/p>\n<p>Use the following command to stop, start nginx and to check it&#8217;s status<\/p>\n<pre style=\"background-color: #f3f3f7;\">sudo systemctl stop nginx\nsudo systemctl start nginx\nsudo systemctl status nginx\n<\/pre>\n<ul>\n<li>If it is running properly, it means that you have not done any mistake in your configuration<\/li>\n<li>Now we need to visit the main IP address to see if we get tomcat page instead of nginx page.<\/li>\n<li>Here, for example we have used:<\/li>\n<\/ul>\n<p><a href=\"http:\/\/52.55.150.107\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">http:\/\/52.55.150.107\/<\/a><\/p>\n<ul>\n<li>If you see the tomcat page, it means that all the traffic that is coming to the route location is being passed to the tomcat, that is setup at the backend<\/li>\n<li>Sometimes, you might not want to send all the traffic. But you would want to send the traffic that is limited to a sub-folder, this is also possible to do, but since we use only one server for one project, we don\u2019t really require that.<\/li>\n<li>You can see that port 8080 need not be opened, because you can access its content via port 80<\/li>\n<\/ul>\n<p><strong>Step 9: Blocking The Unwanted Port 8080<\/strong><\/p>\n<ul>\n<li>For this you can go to \u2018Security Group\u2019 and select \u2018Nginx\u2019 under group name<\/li>\n<li>Under \u2018Inbound\u2019 select \u2018Edit\u2019 option<\/li>\n<li>The new tab appears and under that you can delete the route which allows the access to port 8080<\/li>\n<li>This gives us an extra layer of security where we don\u2019t keep an unwanted port open.<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> <em> Also it is important to block port 8080 if you have a site which has public facing content, which you want to be indexed by search engine <\/em><\/p>\n<ul>\n<li>In these cases, if you serve content from port 80 and port 8080 for Google, then those are two different addresses<\/li>\n<li>It means that it will think that one of your sites serving duplicate content and it might get penalized in search engine results. Hence, it is important just to keep port 80 open instead of port 8080<\/li>\n<li>At last you will see that your browser is not able to reach port 8080<\/li>\n<\/ul>\n<p>This is how we setup nginx as reverse proxy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To setup nginx as reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is a server that is between a user and the web or app server. It is typically used to load balance the traffic to multiple app server. For this tutorial we are going to put apache tomcat server behind [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10146,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[450],"tags":[623],"class_list":["post-10136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mguide","tag-nginx"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2<\/title>\n<meta name=\"description\" content=\"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2\" \/>\n<meta property=\"og:description\" content=\"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\" \/>\n<meta property=\"og:site_name\" content=\"Mobisoft Infotech\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-30T12:38:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-06T09:12:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"853\" \/>\n\t<meta property=\"og:image:height\" content=\"391\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Pritam Barhate\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pritam Barhate\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#article\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\"},\"author\":{\"name\":\"Pritam Barhate\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee\"},\"headline\":\"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2\",\"datePublished\":\"2017-01-30T12:38:45+00:00\",\"dateModified\":\"2025-10-06T09:12:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\"},\"wordCount\":1030,\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg\",\"keywords\":[\"Nginx\"],\"articleSection\":[\"MGuide\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\",\"name\":\"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg\",\"datePublished\":\"2017-01-30T12:38:45+00:00\",\"dateModified\":\"2025-10-06T09:12:59+00:00\",\"author\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee\"},\"description\":\"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.\",\"breadcrumb\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg\",\"contentUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg\",\"width\":853,\"height\":391,\"caption\":\"setting up nginx as reverse proxy on ubuntu 16.04 server on aws ec2 mobisoft- infotech\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mobisoftinfotech.com\/resources\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/\",\"name\":\"Mobisoft Infotech\",\"description\":\"Discover Mobility\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee\",\"name\":\"Pritam Barhate\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g\",\"caption\":\"Pritam Barhate\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2","description":"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","og_locale":"en_US","og_type":"article","og_title":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2","og_description":"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.","og_url":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","og_site_name":"Mobisoft Infotech","article_published_time":"2017-01-30T12:38:45+00:00","article_modified_time":"2025-10-06T09:12:59+00:00","og_image":[{"width":853,"height":391,"url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg","type":"image\/jpeg"}],"author":"Pritam Barhate","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pritam Barhate","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#article","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2"},"author":{"name":"Pritam Barhate","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee"},"headline":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2","datePublished":"2017-01-30T12:38:45+00:00","dateModified":"2025-10-06T09:12:59+00:00","mainEntityOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2"},"wordCount":1030,"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg","keywords":["Nginx"],"articleSection":["MGuide"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","url":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2","name":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage"},"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg","datePublished":"2017-01-30T12:38:45+00:00","dateModified":"2025-10-06T09:12:59+00:00","author":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee"},"description":"To setup Ngnix as a reverse proxy, we are going to use Ubuntu 16.04. A reverse proxy is typically used to load the balanced traffic to multiple app servers.","breadcrumb":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#primaryimage","url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg","contentUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2017\/01\/Setting-Up-Nginx-As-Reverse-Proxy-on-Ubuntu-16.04-Server-on-AWS-EC2-mobisoft-infotech.jpg","width":853,"height":391,"caption":"setting up nginx as reverse proxy on ubuntu 16.04 server on aws ec2 mobisoft- infotech"},{"@type":"BreadcrumbList","@id":"https:\/\/mobisoftinfotech.com\/resources\/mguide\/setting-nginx-reverse-proxy-ubuntu-16-04-server-aws-ec2#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mobisoftinfotech.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Setting Up Nginx As Reverse Proxy On Ubuntu 16.04 Server On AWS EC2"}]},{"@type":"WebSite","@id":"https:\/\/mobisoftinfotech.com\/resources\/#website","url":"https:\/\/mobisoftinfotech.com\/resources\/","name":"Mobisoft Infotech","description":"Discover Mobility","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/fa762036b3364f26abeea146c01487ee","name":"Pritam Barhate","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0e481c7ce54b3567ac70ddfc493523eefce0bdc3ee69fd2654f8f60a79e2f178?s=96&r=g","caption":"Pritam Barhate"}}]}},"_links":{"self":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/10136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/comments?post=10136"}],"version-history":[{"count":13,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/10136\/revisions"}],"predecessor-version":[{"id":43638,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/10136\/revisions\/43638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media\/10146"}],"wp:attachment":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media?parent=10136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/categories?post=10136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/tags?post=10136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}