nginx搭建wordpress

server {
    listen 80;
    root /data/blog.phpfs.com;
    server_name blog.phpfs.com;
    index index.html index.htm index.php;
    access_log /data/logs/nginx/blog.phpfs.com-access.log;
    error_log /data/logs/nginx/blog.phpfs.com-error.log;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
        #access_log off;
        expires 7d;
    }
    location ~ \.php {
        fastcgi_pass unix:/dev/shm/php5-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }
}

 
参考:
https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/



Tagged , . Bookmark the permalink.

Comments are closed.