Skip to content

Instantly share code, notes, and snippets.

@AndiSusanto15
Last active March 8, 2021 12:16
Show Gist options
  • Save AndiSusanto15/abc958e5f0592a4c8776de2afdbcce76 to your computer and use it in GitHub Desktop.
Save AndiSusanto15/abc958e5f0592a4c8776de2afdbcce76 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name batutah.id;
root /home/batutah.id/public_html/batutah.id;
error_log /var/log/nginx/batutah.id_error.log;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass fpm-batutah;
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment