3b6aed1
# Wordpress
3b6aed1
3b6aed1
location = /wordpress {
3b6aed1
    alias /usr/share/wordpress/;
3b6aed1
}
3b6aed1
3b6aed1
location /wordpress/ {
3b6aed1
    root /usr/share;
3b6aed1
    index index.php;
3b6aed1
3b6aed1
    location ~ ^/wordpress/wp-content/uploads/(.+)\.php$ {
3b6aed1
        # Deny access to any php file in the uploads directory
3b6aed1
        deny all;
3b6aed1
    }
3b6aed1
    location ~ ^/wordpress/wp-content/plugins/akismet/(.+)\.php$ {
3b6aed1
        # Deny access to any php file in the akismet directory
3b6aed1
        deny all;
3b6aed1
    }
3b6aed1
3b6aed1
    # Access is only allowed via local access
3b6aed1
    # Change this once configured
3b6aed1
    location ~ ^/wordpress/(.+\.php)$ {
3b6aed1
        allow 127.0.0.1;
3b6aed1
        allow ::1;
3b6aed1
        deny all;
3b6aed1
3b6aed1
        try_files $uri =404;
3b6aed1
        fastcgi_intercept_errors on;
3b6aed1
        include        fastcgi_params;
3b6aed1
        fastcgi_param  SERVER_NAME      $host;
3b6aed1
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
3b6aed1
        fastcgi_pass   php-fpm;
3b6aed1
    }
3b6aed1
}
3b6aed1