Установка Nginx 1.18 на Manjaro

Категория: Nginx

Краткая инструкция по установке Nginx 1.18 на Manjaro Linux.

Ставим Nginx stable:

sudo pacman -Syu nginx

Создаем каталоги:

sudo mkdir /etc/nginx/sites-enabled
sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/conf.d
## или
sudo mkdir /etc/nginx/{sites-enabled, sites-available, conf.d}

Правим конфиг:

sudo nano /etc/nginx/nginx.conf
http {
    # ...

    server {
        listen       80;
        server_name  localhost;
        root         /home/stas/projects/www;

        #charset koi8-r;
        #access_log  logs/host.access.log  main;

        location / {
            #root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        location = /favicon.ico {
            access_log     off;
            log_not_found  off;
        }

        ## @note Pass the PHP scripts to FastCGI server listening
        location ~ \.php$ {
            try_files      $fastcgi_script_name =404;
            #fastcgi_pass   127.0.0.1:9000;
            fastcgi_pass   unix:/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;   
            include        fastcgi.conf; 
        }
    }

    ## @note Load configs
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
}

Перезапускаем nginx:

sudo systemctl restart nginx 
sudo systemctl status nginx

Установка php-fpm и запуск:

sudo pacman -Syu php-fpm
sudo systemctl restart php-fpm

#manjaro, #nginx

категория: Nginx