Skip to content

Instantly share code, notes, and snippets.

@Nyoho
Created August 10, 2016 15:11
Show Gist options
  • Save Nyoho/6c4746491fed5bc43250b33426e0d7a3 to your computer and use it in GitHub Desktop.
Save Nyoho/6c4746491fed5bc43250b33426e0d7a3 to your computer and use it in GitHub Desktop.
nginx の PHP 設定
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/hogehogeserver;
index index.html index.htm index.php;
server_name hogehogeserver.example.net;
location / {
auth_basic "Restricted";
auth_basic_user_file /var/www/hogehogeserver/.htpasswd;
}
location ~ \.(php)$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
error_log /var/log/nginx/hogehogeserver-error.log;
access_log /var/log/nginx/hogehogeserver-access.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment