cd /usr/ports/www/nginx make install clean
/etc/rc.conf nginx_enable="yes"
設定
/usr/local/etc/nginx.conf http { : (略) : include /usr/local/etc/nginx/conf.d/*.conf; #追加 }
/usr/local/etc/nginx/conf.d/example.conf
起動
service nginx start
/usr/local/etc/php.ini
cd /usr/local/etc cp php.ini-production php.ini
/usr/local/etc/php-fpm.d/www.conf
;listen = 127.0.0.1:9000 を listen = /var/run/php-fpm.socket に変更 listen.owner = www listen.group = www listen.mode = 0660 を有効化
php-fpm有効化
/etc/rc.conf php_fpm_enable="yes"
起動
service php-fpm start
server { location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; if (!-f $document_root$fastcgi_script_name) { return 404; } # fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php-fpm.socket; fastcgi_index index.php; include fastcgi_params; # upstream sent too big header というエラーログが出るとき用対応 fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param HTTPS on; } }