Contoh, misalnya untuk domain blog.fadjar.name
yang menggunakan CMS WordPress
server {
listen 0.0.0.0:80;
server_name blog.fadjar.name www.blog.fadjar.name;
access_log /var/log/nginx/blog.fadjar.name.access.log main;
location / {
root /data_web/blog.fadjar.name;
index index.html index.htm index.php;
# Script for permalink WP
if (!-e $request_filename) {
rewrite ^/(.*)$ /?q=$1 last;
}
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data_web/blog.fadjar.name;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data_web/blog.fadjar.name$fastcgi_script_name;
include fastcgi_params;
}
}