{"id":16,"date":"2022-07-28T09:24:20","date_gmt":"2022-07-28T09:24:20","guid":{"rendered":"https:\/\/formatswap.com\/blog\/?p=16"},"modified":"2023-09-16T23:36:13","modified_gmt":"2023-09-16T23:36:13","slug":"how-to-install-and-configure-nginx-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/","title":{"rendered":"How to install and configure Nginx &#8211; Ubuntu 20.04"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"426\" loading=\"lazy\" src=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png\" alt=\"splash image install nginx\" class=\"wp-image-128\" srcset=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png 1024w, https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-300x125.png 300w, https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-768x320.png 768w, https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1536x639.png 1536w, https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1.png 1855w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>What is <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nginx\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a>? <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nginx\">Nginx<\/a> is a opensource web server designed with developers in mind. It was created by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Igor_Sysoev\" target=\"_blank\" rel=\"noreferrer noopener\">Igor Sysoev<\/a> in 2004. It supports <a href=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-setup-nginx-as-a-reverse-proxy-on-ubuntu-22-04-lts\/\">reverse proxying<\/a>, caching, load balancing, <a href=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-an-nginx-rtmp-server-in-ubuntu-22-04\/\">RTMP media streaming<\/a>, and many more advanced features. In this tutorial you will learn how to install and set up <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nginx\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a> on Ubuntu 20.04.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n\n\n<p>Open your terminal prompt of choice.<\/p>\n\n\n\n<p>Update your packages repository and packages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n\n\n\n<p>Then, install <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nginx\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up UFW Firewall (Optional &#8211; Highly Recommended)<\/h2>\n\n\n\n<p>If UFW is not enabled or configured, you will first need to enable it. You can check the status of the firewall using this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw status<\/code><\/pre>\n\n\n\n<p>Then enable it with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw enable<\/code><\/pre>\n\n\n\n<p>If you are connected to your machine via SSH, make sure it is allowed through the firewall before disconnecting.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow ssh<\/code><\/pre>\n\n\n\n<p>Next, we will be allowing <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nginx\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a> through the firewall &#8211; there are 3 settings to be aware of when allowing the web server through. &#8216;Nginx Full&#8217;, &#8216;Nginx HTTP&#8217;, and &#8216;Nginx HTTPS&#8217;. &#8216;Nginx Full&#8217; allows traffic through both HTTP (port 80) and HTTPS (port 443), whereas HTTP and HTTPS open only their respective ports. It is highly recommended that you only open port 80 to your local network or for non-secure pages (Does NOT process sensitive data!). You will only be able to use HTTPS if you have an SSL certificate &#8211; otherwise, your browser or any visitor to your site will get a &#8216;Site Not Secure&#8217; warning. We will be using &#8216;Nginx HTTP&#8217; for the purposes of the tutorial, but you may replace the text in the command with the other parameters for your respective use case.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 'Nginx HTTP'<\/code><\/pre>\n\n\n\n<p>If you have any other services running on the machine that you need external clients to have access to, such as port 8080 for a testing server, you may open them with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow &lt;port&gt;\/&lt;method&gt;\nExample: sudo ufw allow 8080\/tcp\nExample: sudo ufw allow 8000\/udp<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Nginx<\/h2>\n\n\n\n<p>Finally, it&#8217;s time to set up your web server! We will be accessing the root directory for the site, where you will access and store your files. We will also be setting up the configuration for the enabled sites so you can access your site from the web. You should be able to see the default site when going to the URL\/IP address of the server.<\/p>\n\n\n\n<p>You can view the IP address of your server by typing the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip a s<\/code><\/pre>\n\n\n\n<p>Your IP will be the address that is not the loopback address (127.0.0.1) and is usually the second &#8220;inet&#8221; address depending on your server&#8217;s configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"569\" height=\"206\" loading=\"lazy\" src=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/nginx.png\" alt=\"welcome to nginx splash screen\" class=\"wp-image-288\" srcset=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/nginx.png 569w, https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/nginx-300x109.png 300w\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" \/><\/figure>\n\n\n\n<p>If everything is set up correctly, the above image should be the contents of the page.<\/p>\n\n\n\n<p>Next, you will navigate to your site&#8217;s configuration to organize things properly and keep your install clean. First, you will disable your site&#8217;s default configuration. You can do this by typing the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> sudo unlink \/etc\/nginx\/sites-enabled\/default<\/code><\/pre>\n\n\n\n<p>Then, add a new configuration file for your site. We will be using nano for this example.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/sites-available\/&lt;site-name&gt;<\/code><\/pre>\n\n\n\n<p>And add the following text to the file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    listen &#91;::]:80;\n    root \/var\/www\/&lt;site-name&gt;;\n    index index.html;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n}<\/code><\/pre>\n\n\n\n<p>If you are also using SSL, you must insert the following below the first server block:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 443 ssl;\n    root \/var\/www\/&lt;site-name&gt;;\n    index index.html;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n}<\/code><\/pre>\n\n\n\n<p>Press CTRL+X and then press Y to save the file.<\/p>\n\n\n\n<p>The server is almost set! You will need to enable the site to make it accessible. You can do this by typing the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ln -s \/etc\/nginx\/sites-available\/&lt;site-name&gt; \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n\n\n\n<p>Then test your configuration using the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p>If everything checks out, you can restart your Nginx process.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Final Steps<\/h2>\n\n\n\n<p>You must add the directory to your server before you are able to store your files and make them available.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/var\/www\/&lt;site-name&gt;<\/code><\/pre>\n\n\n\n<p>Lastly, create a an index page for your server and you are all set!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/var\/www\/&lt;site-name&gt;\/index.html<\/code><\/pre>\n\n\n\n<p>Here is some example code that you can use for testing to make sure everything is working:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;html&gt;\n&lt;body&gt;\n    &lt;h1&gt;Hello, Nginx!&lt;\/h1&gt;\n    &lt;p&gt;This is a test page for Nginx.&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"202\" height=\"90\" loading=\"lazy\" src=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/nginx-2.png\" alt=\"test page for nginx\" class=\"wp-image-291\"\/><\/figure>\n\n\n\n<p>If you see this message, you have successfully set up your very own Nginx server on Ubuntu 20.04!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Resources<\/h2>\n\n\n\n<p>View our list of <a href=\"https:\/\/formatswap.com\/blog\/programming\/the-top-5-programming-languages-to-learn-in-2022\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Top 5 Programming Languages to Learn in 2022<\/a>.<\/p>\n\n\n\n<p>You may also like <a href=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/the-5-best-linux-distributions-to-install-in-2022\/\" target=\"_blank\" rel=\"noreferrer noopener\">The 5 Best Linux Distributions to Install in 2022<\/a>.<\/p>\n\n\n\n<p>Setting up <a href=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-mysql-on-ubuntu-server-22-04-lts\/\">MySQL on Ubuntu 22.04<\/a><\/p>\n\n\n\n<p>View our <a href=\"https:\/\/formatswap.com\/blog\/category\/programming\/\" target=\"_blank\" rel=\"noreferrer noopener\">Programming Articles and Tutorials<\/a>.<\/p>\n\n\n\n<p>Learn more cool things in Linux with our <a href=\"https:\/\/formatswap.com\/blog\/category\/linux-tutorials\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux Tutorials<\/a>.<\/p>\n\n\n\n<p>View all of our available online tools and converters at <a href=\"https:\/\/formatswap.com\" target=\"_blank\" rel=\"noreferrer noopener\">Formatswap.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Nginx? Nginx is a opensource web server designed with developers in mind. It was created by Igor Sysoev in 2004. It supports reverse proxying, caching, load balancing, RTMP media streaming, and many more advanced features. In this tutorial you will learn how to install and set up Nginx on Ubuntu 20.04. Getting Started [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[4],"tags":[8,28,14,31],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-linux-tutorials","tag-linux","tag-nginx","tag-tutorial","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials<\/title>\n<meta name=\"description\" content=\"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials\" \/>\n<meta property=\"og:description\" content=\"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Format Swap - Tech Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-28T09:24:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-16T23:36:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/#\\\/schema\\\/person\\\/3d01ee8e1e4f3718cfcc57eeb8ad6188\"},\"headline\":\"How to install and configure Nginx &#8211; Ubuntu 20.04\",\"datePublished\":\"2022-07-28T09:24:20+00:00\",\"dateModified\":\"2023-09-16T23:36:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/\"},\"wordCount\":681,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/hello-world-1-1024x426.png\",\"keywords\":[\"linux\",\"nginx\",\"tutorial\",\"ubuntu\"],\"articleSection\":[\"Linux Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/\",\"name\":\"How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/hello-world-1-1024x426.png\",\"datePublished\":\"2022-07-28T09:24:20+00:00\",\"dateModified\":\"2023-09-16T23:36:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/#\\\/schema\\\/person\\\/3d01ee8e1e4f3718cfcc57eeb8ad6188\"},\"description\":\"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/hello-world-1.png\",\"contentUrl\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/hello-world-1.png\",\"width\":1855,\"height\":772},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/linux-tutorials\\\/how-to-install-and-configure-nginx-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install and configure Nginx &#8211; Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/\",\"name\":\"Format Swap - Tech Tutorials\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/#\\\/schema\\\/person\\\/3d01ee8e1e4f3718cfcc57eeb8ad6188\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/formatswap.com\\\/blog\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCsIPLkRPTbbTaT8YX0Dh2-A\"],\"url\":\"https:\\\/\\\/formatswap.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials","description":"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.","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:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials","og_description":"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.","og_url":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/","og_site_name":"Format Swap - Tech Tutorials","article_published_time":"2022-07-28T09:24:20+00:00","article_modified_time":"2023-09-16T23:36:13+00:00","og_image":[{"url":"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/"},"author":{"name":"admin","@id":"https:\/\/formatswap.com\/blog\/#\/schema\/person\/3d01ee8e1e4f3718cfcc57eeb8ad6188"},"headline":"How to install and configure Nginx &#8211; Ubuntu 20.04","datePublished":"2022-07-28T09:24:20+00:00","dateModified":"2023-09-16T23:36:13+00:00","mainEntityOfPage":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/"},"wordCount":681,"commentCount":0,"image":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png","keywords":["linux","nginx","tutorial","ubuntu"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/","url":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/","name":"How to install and configure Nginx - Ubuntu 20.04 - Format Swap - Tech Tutorials","isPartOf":{"@id":"https:\/\/formatswap.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1-1024x426.png","datePublished":"2022-07-28T09:24:20+00:00","dateModified":"2023-09-16T23:36:13+00:00","author":{"@id":"https:\/\/formatswap.com\/blog\/#\/schema\/person\/3d01ee8e1e4f3718cfcc57eeb8ad6188"},"description":"In this tutorial you will learn how to install and configure Nginx on Ubuntu 20.04. You will also learn how to block unwanted requests.","breadcrumb":{"@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#primaryimage","url":"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1.png","contentUrl":"https:\/\/formatswap.com\/blog\/wp-content\/uploads\/2022\/07\/hello-world-1.png","width":1855,"height":772},{"@type":"BreadcrumbList","@id":"https:\/\/formatswap.com\/blog\/linux-tutorials\/how-to-install-and-configure-nginx-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/formatswap.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install and configure Nginx &#8211; Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/formatswap.com\/blog\/#website","url":"https:\/\/formatswap.com\/blog\/","name":"Format Swap - Tech Tutorials","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/formatswap.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/formatswap.com\/blog\/#\/schema\/person\/3d01ee8e1e4f3718cfcc57eeb8ad6188","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/55cb3548d8c931eac3f2facbca246c6bde86082f48ca304906d7da2214191b72?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/formatswap.com\/blog","https:\/\/www.youtube.com\/channel\/UCsIPLkRPTbbTaT8YX0Dh2-A"],"url":"https:\/\/formatswap.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":5,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":1485,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions\/1485"}],"wp:attachment":[{"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/formatswap.com\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}