reset password

Nginx Configuration

1. Virtual Host

2. HTTPS

3. PHP

First install FastCGI Process Manager:

> sudo apt install php-fpm

You need to pay attention to which PHP version is installed (e.g. php7.0 or php7.2) as this version number is used in various places later. Here we assume it's 7.2.

Edit /etc/php/7.2/fpm/php.ini and set cgi.fix_pathinfo to 0 as recommended here, then restart the PHP processor:

> sudo systemctl restart php7.2-fpm

Edit /ect/nginx/sites-available/default, uncomment the parts related to php-fpm and add index.php (read the comments in the file carefully). You'll need to change php7.0-fpm.sock to the actual PHP version number (e.g. php7.2-fpm.sock). Save and check the configuration and reload Nginx.

4. Reverse Proxy

5. Misc.

6. Common Commands

sudo nginx -t Check configuration files for syntax errors
sudo systemctl reload nginx Reload configuration

 

This page has been viewed 2913 times.