Share Everything to Everyone

Sabtu, 16 September 2017

Konfigurasi Nginx Untuk Codeigniter

00.14 Posted by ROSYID'S BLOG No comments
Masuk ke konfigurasi nginx : # sudo nano /etc/nginx/sites-available/default
hapus dan copy script berikut :

server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;

#ip server localhost
server_name 111.222.333.444;
location / {
try_files $uri $uri/ = 404;
}

#php fpm
location ~ [^/]\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# blokir htaccess milik apache
location ~ /\.ht {
deny all;
}
}

kemudian restart servicenya
# sudo service php7.0-fpm restart && sudo service nginx reload

0 komentar:

Posting Komentar