{"id":271,"date":"2018-09-25T06:26:00","date_gmt":"2018-09-25T06:26:00","guid":{"rendered":""},"modified":"2019-07-03T13:16:15","modified_gmt":"2019-07-03T13:16:15","slug":"forward-and-reverse-proxy","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2018\/09\/25\/forward-and-reverse-proxy\/","title":{"rendered":"Forward and Reverse Proxy"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<h2 style=\"text-align:left;\">Overview<\/h2>\n<p>Before talking about forward proxy and reverse proxy let&#8217;s talk about what is the meaning of proxy.<br \/>\nBasically proxy means someone or something is acting on behalf of someone.<br \/>\nIn the technical realm, we are talking about one server is acting behalf of the other servers.<\/p>\n<p>In this blog, we will talk about web proxies. So basically we have two types of web&nbsp;proxies:-<\/p>\n<ul style=\"text-align:left;\">\n<li><b>Forward Proxy<\/b><\/li>\n<li><b>Reverse Proxy<\/b><\/li>\n<\/ul>\n<div style=\"text-align:left;\">The forward proxy is used by the client, for example:- web browser, whereas reverse proxy is used by the server such as web server.<\/div>\n<h3 style=\"text-align:left;\"><b>Forward Proxy<\/b><\/h3>\n<div>In Forward Proxy, proxy retrieves data from another website on the behalf of original requestee. For example:- If an IP is blocked for visiting a particular website then the person(<i>client<\/i>) can use the forward proxy to hide the real IP of the client and can visit the website easily.<\/div>\n<div><\/div>\n<div>Let&#8217;s take another example to understand it more clearly. For example, we have 3 server<\/div>\n<div><\/div>\n<div>Client&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&gt; Your computer from which you are sending the request<\/div>\n<div>Proxy Site&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt; The proxy server, proxy.example.com<\/div>\n<div>Main Web server&nbsp; &nbsp; -&gt; The website you want to see<\/div>\n<div><\/div>\n<div>Normally connection can happen like this&nbsp;<\/div>\n<div><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><a href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/7c5d0-blank2bdiagram2b252812529.png\" style=\"margin-left:1em;margin-right:1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"132\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/7c5d0-blank2bdiagram2b252812529.png?w=300\" width=\"400\"><\/a><\/div>\n<div>In the forward proxy, the connection will happen like this<\/div>\n<div><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><a href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/1ef0b-blank2bdiagram2b252822529.png\" style=\"margin-left:1em;margin-right:1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"137\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/1ef0b-blank2bdiagram2b252822529.png?w=300\" width=\"640\"><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><\/div>\n<div>So here the <b>proxy client<\/b> is talking to the <b>main web server <\/b>on the behalf of <b>the client<\/b>.<\/div>\n<div><\/div>\n<div>The forward proxy also acts as a cache server. For example:- If the content is downloading multiple times the proxy can cache the content on the server so next time when another server is downloading the same content, the proxy will send the content that is&nbsp;previously stored&nbsp;on the server to another server.<span>&nbsp;<\/span><\/div>\n<div><\/div>\n<h3 style=\"text-align:left;\">&nbsp;Reverse Proxy<\/h3>\n<div>The reverse proxy is used by the server to maintain load and to achieve high availability. A website may have multiple servers behind the reverse proxy. The reverse proxy takes requests from the client and forwards these requests to the web servers. Some tools for reverse proxy are <b>Nginx, HaProxy<\/b>.<\/div>\n<div><\/div>\n<div>So let&#8217;s take the similar example as the forward proxy<\/div>\n<div><\/div>\n<div>Client&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&gt; Your computer from which you are sending the request<\/div>\n<div>Proxy Site&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt; The proxy server, proxy.example.com<\/div>\n<div>Main Web server&nbsp; &nbsp; -&gt; The website you want to see<\/div>\n<div><\/div>\n<div><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><a href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/e46c8-blank2bdiagram2b252832529.png\" style=\"margin-left:1em;margin-right:1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"138\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2018\/09\/e46c8-blank2bdiagram2b252832529.png?w=300\" width=\"640\"><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><\/div>\n<div><\/div>\n<div>Here it is better to restrict the direct access to the <b>Main Web Server <\/b>and force the requests or requestors to go through <b>Proxy Server <\/b>first. So data is being retrieved by <b>Proxy Server <\/b>on the behalf of <b>Client<\/b>.<\/div>\n<div><\/div>\n<div>\n<ul style=\"text-align:left;\">\n<li>So the difference between Forward Proxy and Reverse Proxy is that in <b>Reverse Proxy <\/b>the user doesn&#8217;t know he is accessing <b>Main Web Server<\/b>, because of the user only communicate with <b>Proxy Server<\/b>.<\/li>\n<li>The <b>Main Web Server <\/b>is invisible for the user and only <b>Reverse Proxy Server <\/b>is visible. The user thinks that he is communicating with <b>Main Web Server&nbsp;<\/b>but actually <b>Reverse Proxy Server <\/b>is forwarding the requests to the <b>Main Web Server<\/b>.<\/li>\n<\/ul>\n<\/div>\n<div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Before talking about forward proxy and reverse proxy let&#8217;s talk about what is the meaning of proxy. Basically proxy means someone or something is acting on behalf of someone. In the technical realm, we are talking about one server is acting behalf of the other servers. In this blog, we will talk about web &hellip; <a href=\"https:\/\/opstree.com\/blog\/2018\/09\/25\/forward-and-reverse-proxy\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Forward and Reverse Proxy&#8221;<\/span><\/a><\/p>\n","protected":false},"author":89038429,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[768739308,6987670,768739301,114254396,301202],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-4n","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/271"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/89038429"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=271"}],"version-history":[{"count":2,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions\/682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}