The blog about containerisation, virtual machines and useful shell snippets and findings

Egeya blog engine nginx configuration with human readable URLs

server {
  server_name egeya.it-premium;
  root /home/nexus/e2_distr_v2858;

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include fastcgi_params;
  }

    location ~* ^.+\.(jpg|jpeg|gif|css|html|htm|png|js)$ {
                root  /home/nexus/e2_distr_v2858;
                access_log off;
                expires 30d;
    }

    error_page  404             /errors/404.html;

    location / {
        root  /home/nexus/e2_distr_v2858;
        index  index.php index.html index.htm home.php;
        log_not_found  off;

	rewrite ^/(.*\.(css|js|ico|gif|jpg|jpeg|png|swf|mp3))$ /$1 last;
        rewrite ^([^.]*[^/])$ $1/ permanent;
        try_files       $uri $uri/ @rewrite;
        #rewrite ^(.*)$ /index.php?go=$1 last;
	#rewrite ^/(.*)$ /index.php?go=$1 last;
   }
   location @rewrite {
        rewrite     ^/(.*)$ /?go=$1&$args;
   }

  #error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}