Installing a Web server
apt-get install nginx -yCustomization Nginx
server {
listen *:80;
server_name spacecore.pro; # site domain
client_max_body_size 1000M; # the maximum file size transmitted through the site
error_page 404 = @notfound;
location / {
root /home/site/spacecore; # the path to the site
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.php;
}
# Подключения PHP, if you don't need it, then erase lines 13 to 21
location ~ \.(php|html|htm)$ {
try_files $uri =404;
root /home/site/spacecore; # the path to the site
fastcgi_pass unix:/run/php/php7.0-fpm.sock; # the path to php
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
}Notes on PHP
Connecting an SSL certificate to Nginx
Checking for Apache2
Removal Nginx
Last updated