W . A . X . O
ncc-1701
LINUX - UNIX




Nginx

  • URL : https://www.nginx.com + http://nginx.org
  • sudo apt-get install nginx : serveur opérationnel
  • vhosts : /etc/nginx/sites-available et /etc/nginx/sites-enabled
  • sudo apt-get install php-cli php-fpm
  • sudo /etc/init.d/php7.0-fpm restart
  • sudo /etc/init.d/nginx restart


====== VHOST ======

server {
	client_max_body_size	20M;
	listen   80; ## listen for ipv4

	server_name  xxxxx.org www.xxxxxx.org;

	access_log  /var/log/nginx/xxxxx.access.log;
	error_log   /var/log/nginx/xxxxx.error.log;

	location / {
		root   /uuuuu/zzzzzz/xxxxx/www;
		index  index.html index.htm index.php;
	}

	location /prive {
		root   /uuuuu/zzzzzz/xxxxx/www;
		index  index.html index.htm index.php;
      		auth_basic "Restricted Access";
      		auth_basic_user_file /home/admin/list-users;
	}


    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        #fastcgi_pass  127.0.0.1:9988;
    	fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME  /uuuuu/zzzzzz/xxxxx/www$fastcgi_script_name;
    }
}