nginx配置文件零碎知识

转发流量

server {
    listen       80;
    server_name  _;
    location / {
        proxy_pass http://127.0.0.1:666;
    }
}

PHP配置

server {
	listen 80;
        server_name  _;
	root	/var/www/html;
	location / {
		index	index.php index.html index.htm;
	}
	location ~\.php$ {
		fastcgi_pass	127.0.0.1:9000;
                # fastcgi_pass   unix:/run/php-fpm.sock;
		fastcgi_index	index.php;
		fastcgi_param	SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		include		    fastcgi_params;
	}
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注