香橙派折腾日记-Nginx配置多网页

mkdir /etc/nginx/vhosts

vim /etc/nginx/nginx.conf

include /etc/nginx/vhosts/*.conf;

网页配置模板:

server {
	listen 80;
	listen [::]:80;

	root /var/www/demo;

	index index.html index.htm index.nginx-debian.html index.php;

	server_name _;

	location / {
		index  index.html index.htm index.php default.html default.htm default.php;
        }

        location ~\.php$ {
                fastcgi_pass unix:/run/php/php7.2-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

 

 

THE END
分享
二维码
海报
香橙派折腾日记-Nginx配置多网页
mkdir /etc/nginx/vhosts vim /etc/nginx/nginx.conf include /etc/nginx/vhosts/*.conf; 网页配置模板: server { listen 80; listen [::]:80; root ……