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/thisisjoes.site

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

Enter the configuration:

server {
  listen 0.0.0.0:80;
  index index.php;
  root /var/www/thisisjoes.site;

  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/thisisjoes.site /etc/nginx/sites-enabled/thisisjoes.site

Test the configuration:

sudo nginx -t

Reload NGINX:

sudo service nginx reload