Page History

Configuring NGINX

Joe edited this page 16 days ago

Clone this wiki locally
You can clone HTTP or SSH.

Open a new configuration file:

sudo nano /etc/nginx/sites-available/

You may use any editor you want. You may use any name for the file.

Enter the configuration:

server {
  index index.php;
  root /var/www/;

  location / {
    try_files $uri $uri/ =404;
  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;

You may change the port to something other than "80". You must change the root to the correct path.

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Test the configuration:

sudo nginx -t

Reload NGINX:

sudo service nginx reload