Skip to main content

nginx on Ubuntu

nginx - HTTP and reverse proxy server, mail proxy server.

Install: sudo apt install nginx
Install: sudo apt install nginx

Check version: nginx -v
Check version: nginx -v

/etc/nginx/nginx.conf

events {
    work_connections    1024;
}

http {
    # Hide version
    server_tokens    off;
    # Enable gzip compression
    gzip    on;
    # Enable cache
    expires    365d;

    server {
        listen    80;
        server_name    localhost;

        location / {
            root html;           
        }
        
        # PHP-CGI configuration
        location ~ \.php$ {
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_index   index.php;     
            fastcgi_param   SCRIPT_NAME    $document_root$fastcgi_script_name;
            include         fastcgi_params; 
        }

    }
}

sudo apt update
sudo apt install -y nginx : Install nginx

nginx -v : Check nginx version
nginx -V : Check nginx version, compiler version, and configure script parameters

/etc/nginx/nginx.conf : nginx default configuration file
/var/log/nginx/ : nginx default log directory

Errors

sudo apt update

nginx N: Skipping acquire of configured file 'nginx/binary-i386/Packages' as repository 'http://nginx.org/packages/mainline/ubuntu bionic InRelease' doesn't support architecture 'i386'

Edit /etc/apt/sources.list file

# deb https://nginx.org/packages/mainline/ubuntu/ bionic nginx
# deb-src https://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb [arch=amd64] https://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb-src [arch=amd64] https://nginx.org/packages/mainline/ubuntu/ bionic nginx

Popular posts from this blog

Python: Free Online Courses

Ever thinking about which programming language to learn first? You can learn Python for free with these online courses.

How to charge your device from USB Port

First of all, check BIOS Settings of your laptop or desktop Dell Look for USB PowerShare BIOS Settings: USB PowerShare Lenovo Look for Always On USB Charge in Off Mode BIOS Settings: Enable Always On USB Charge in Off Mode

Qubes OS: Fedora 30

Create a new Standalone VM based on fedora-29 VM template Extend root partition: run command on dom0 tuyen@dom0:~ $ qvm-volume extend fedora-30:root 12288MB Set qrexec_timeout to 600 seconds tuyen@dom0:~ $ qvm-pref --set fedora-30 qrexec_timeout 600 $ sudo dnf upgrade --refresh $ sudo dnf install dnf-plugin-sytem-upgrade $ sudo dnf system-upgrade download --release=30 Install fedora-30 template Run the following command on dom0 terminal $ sudo qubes-dom0-update qubes-template-fedora-30 Install Adobe Flash Player Adobe Flash Player will not go away soon. So, let's grab the latest version of Adobe Flash Player , then install using yum or dnf command. Verify if Adobe Flash Player is installed and works by visiting https://helpx.adobe.com/flash-player.html [user@fedora-30 ~]$ sudo dnf install Downloads/flash-player-npapi-32.0.0.238-release.x86_64.rpm Last metadata expiration check: 0:37:03 ago on Fri Aug 30 09:18:10 2019. Dependencies resolved. =========...