Skip to content

Instantly share code, notes, and snippets.

@Harsh-js
Forked from piyushgarg-dev/install_nginx.md
Created October 6, 2023 11:04
Show Gist options
  • Save Harsh-js/b076f7ae99d7a4724feb0ac7d41e2ed7 to your computer and use it in GitHub Desktop.
Save Harsh-js/b076f7ae99d7a4724feb0ac7d41e2ed7 to your computer and use it in GitHub Desktop.

Revisions

  1. Piyush Garg revised this gist Mar 7, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install_nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    Video Tutorial: https://youtu.be/Qmld1te08Ns

    ## Nginx Ubuntu Installation

    Update Packages
  2. Piyush Garg revised this gist Mar 7, 2023. 1 changed file with 64 additions and 1 deletion.
    65 changes: 64 additions & 1 deletion install_nginx.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,67 @@ Start Nginx Server
    nginx
    ```

    Now visit `http://localhost:80``` and you would be able to see default nginx welcome page.
    Now visit `http://localhost:80` and you would be able to see default nginx welcome page.

    ## Nginx Docker Installation

    Run Docker Ubuntu Image
    ```sh
    docker run -it -p 8080:80 ubuntu
    ```

    Update Packages
    ```sh
    sudo apt-get update
    ```

    Install Nginx
    ```sh
    sudo apt-get install nginx
    ```

    Verify Installation
    ```sh
    sudo nginx -v
    ```
    Start Nginx Server
    ```sh
    nginx
    ```
    Now visit `http://localhost:8080` and you would be able to see default nginx welcome page.

    ## Nginx Conf File

    Install VIM
    ```sh
    sudo apt-get install vim
    ```

    Open `nginx.conf` file
    ```sh
    vim etc/nginx/nginx.conf
    ```

    Type Sample Nginx Conf
    ```
    events {
    }
    http {
    server {
    listen 80;
    server_name _;
    location / {
    return 200 "Hello from Nginx Sever";
    }
    }
    }
    ```

    Reload Nginx
    ```
    nginx -s reload
    ```

    Visit `localhost:8080` or `localhost:80` and you should see Hello from Nginx Sever on browser.
  3. Piyush Garg revised this gist Mar 7, 2023. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions install_nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### Nginx Ubuntu Installation
    ## Nginx Ubuntu Installation

    Update Packages
    ```sh
    @@ -13,4 +13,10 @@ sudo apt-get install nginx
    Verify Installation
    ```sh
    sudo nginx -v
    ```
    ```
    Start Nginx Server
    ```sh
    nginx
    ```

    Now visit `http://localhost:80``` and you would be able to see default nginx welcome page.
  4. Piyush Garg created this gist Mar 7, 2023.
    16 changes: 16 additions & 0 deletions install_nginx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ### Nginx Ubuntu Installation

    Update Packages
    ```sh
    sudo apt-get update
    ```

    Install Nginx
    ```sh
    sudo apt-get install nginx
    ```

    Verify Installation
    ```sh
    sudo nginx -v
    ```