Skip to content

Instantly share code, notes, and snippets.

@iqbwl
Last active July 16, 2025 06:55
Show Gist options
  • Select an option

  • Save iqbwl/fee21a7e0cabbaa9f8df50d4cdec5897 to your computer and use it in GitHub Desktop.

Select an option

Save iqbwl/fee21a7e0cabbaa9f8df50d4cdec5897 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name _;
root /var/www/public/wordpress;
index index.php index.html index.htm;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock; # Ganti sesuai versi PHP yang kamu pakai
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires max;
log_not_found off;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
# Disable .htaccess and hidden files
location ~ /\. {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment