Install nginx on raspbian jessie – RCK

Proceed as pi.

Update the package list

sudo apt-get update

Install nginx

sudo apt-get install nginx openssl ssl-cert libapr1 libtool curl libcurl4-openssl-dev varnish

Changing the default config

cd /etc/nginx/sites-available
sudo mv default default.bak
sudo nano default

It should look like this:

upstream php-handler {
  #server unix:/var/run/php5-fpm.sock;
server {
  listen 80;
  # Path to the root of your installation
  root /home/pi/wp;
  client_max_body_size 20000M; # set max upload size
  fastcgi_buffers 64 4K;
  index index.php index.html;
  location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
    deny all;
  location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTPS off;
    fastcgi_pass php-handler;
  # Optional: set long EXPIRES header on static assets
  location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
    expires 30d;
    # Optional: Don't log access to assets
    access_log off;

Make Directory

mkdir /home/pi/wp
nano /home/pi/wp/index.html

It should look like this:

Start nginx

sudo service nginx start


Leave a Reply

Your email address will not be published. Required fields are marked *