{"id":16104,"date":"2024-11-19T09:44:10","date_gmt":"2024-11-19T09:44:10","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=16104"},"modified":"2024-11-19T09:44:12","modified_gmt":"2024-11-19T09:44:12","slug":"setting-up-a-reverse-proxy-with-nginx-on-almalinux-9","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/","title":{"rendered":"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9"},"content":{"rendered":"\n<p>As a software developer or system administrator, you might have to set up a reverse proxy to streamline your server architecture. You can do this by centralizing access to web applications, enhancing security, and enhancing load balancing.&nbsp;<\/p>\n\n\n\n<p>Nginx is a powerful and versatile web server that is often employed for this purpose. In this article, we will guide you through the process of setting up a reverse proxy with Nginx on AlmaLinux 9, a robust and open-source enterprise-level Linux distribution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Nginx<\/h2>\n\n\n\n<p>To begin, ensure that your system packages are up-to-date. Run the following command:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update -y<\/code><\/pre>\n\n\n\n<p>Next, install Nginx:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install nginx -y<\/code><\/pre>\n\n\n\n<p>Once installed, start and enable the Nginx service to run on boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start nginx\nsudo systemctl enable nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Nginx as a Reverse Proxy<\/h2>\n\n\n\n<p>Your website&#8217;s Nginx configuration file should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/conf.d\/your_domain.conf<\/code><\/pre>\n\n\n\n<p>Substitute &#8216;your_domain.com&#8217; for your domain name and &#8216;backend_server_ip&#8217; for the IP address of your backend server in the following server block:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n&nbsp;&nbsp;&nbsp; listen 80;\n&nbsp;&nbsp;&nbsp; server_name your_domain.com;\n&nbsp;&nbsp;&nbsp; location \/ {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_pass http:\/\/backend_server_ip;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header Host $host;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header X-Real-IP $remote_addr;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header X-Forwarded-Proto $scheme;\n&nbsp;&nbsp;&nbsp; }\n}<\/code><\/pre>\n\n\n\n<p>Save and exit the file.<\/p>\n\n\n\n<p>Check the Nginx configuration for syntax errors:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p>If your configuration testing is successful, reload Nginx to apply the modification.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Securing Your Reverse Proxy with SSL\/TLS<\/h2>\n\n\n\n<p>To secure your reverse proxy, you can use Let\u2019s Encrypt to obtain a free SSL certificate, you need to install the Certbot client and the Nginx plugin:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install certbot python3-certbot-nginx -y<\/code><\/pre>\n\n\n\n<p>To obtain and install an SSL\/TLS certificate, run Certbot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo certbot --nginx -d your_domain.com<\/code><\/pre>\n\n\n\n<p>Follow the on-screen prompts to complete the process. Certbot will automatically update your Nginx configuration to use the acquired SSL\/TLS certificate.<\/p>\n\n\n\n<div class=\"vlt-box \">\n<div class=\"box-title\" style=\"background:#D5EAFF; color:#000\">Conclusion<\/div>\n<div class=\"box-content\" >\n<p>After following these steps, you have successfully set up Nginx as a reverse proxy on your AlmaLinux 9 server. Your applications are secured, and the server architecture is optimized for performance and reliability. Well, if managing your server infrastructure is becoming challenging or requires additional expertise in carrying out complex configurations, then it is possible to hire remote DevOps engineers to help you streamline the processes in your deployment and operations.<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a software developer or system administrator, you might have to set up a reverse proxy to streamline your server architecture. You can do this by centralizing access to web applications, enhancing security, and enhancing load balancing.&nbsp; Nginx is a powerful and versatile web server that is often employed for this purpose. In this article, [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-16104","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting Up a Reverse Proxy with Nginx on AlmaLinux 9<\/title>\n<meta name=\"description\" content=\"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9\" \/>\n<meta property=\"og:description\" content=\"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-19T09:44:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-19T09:44:12+00:00\" \/>\n<meta name=\"author\" content=\"Ujwala\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ujwala\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/\",\"name\":\"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2024-11-19T09:44:10+00:00\",\"dateModified\":\"2024-11-19T09:44:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8\"},\"description\":\"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8\",\"name\":\"Ujwala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g\",\"caption\":\"Ujwala\"},\"description\":\"My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ujwala\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9","description":"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.","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:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/","og_locale":"en_GB","og_type":"article","og_title":"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9","og_description":"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2024-11-19T09:44:10+00:00","article_modified_time":"2024-11-19T09:44:12+00:00","author":"Ujwala","twitter_misc":{"Written by":"Ujwala"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/","name":"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2024-11-19T09:44:10+00:00","dateModified":"2024-11-19T09:44:12+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8"},"description":"Learn how to configure Nginx as a reverse proxy server on AlmaLinux 9. Secure your web applications, load balance traffic, and optimize performance with this comprehensive guide.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/setting-up-a-reverse-proxy-with-nginx-on-almalinux-9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Setting Up a Reverse Proxy with Nginx on AlmaLinux 9"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8","name":"Ujwala","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g","caption":"Ujwala"},"description":"My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ujwala\/"}]}},"views":0,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=16104"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16104\/revisions"}],"predecessor-version":[{"id":16105,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16104\/revisions\/16105"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=16104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=16104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=16104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}