nginx
sites-available/default

    location = /index.php {
        include php.conf;

        fastcgi_pass php-fpm_mbeck;

        fastcgi_param PHP_ADMIN_FLAG "log_errors=on";
        fastcgi_param PHP_FLAG "display_errors=off";
    }


    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

php.conf

fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

upstreams/php-fpm_mbeck

# Upstream to abstract backend connection(s) for php
upstream php-fpm_mbeck {
        server unix:/tmp/php-fpm_mbeck.sock;
}

php-fpm
pool.d/mbeck.conf

[mbeck]
listen = /tmp/php-fpm_mbeck.sock
listen.backlog = -1
listen.owner = mbeck
listen.group = mbeck
listen.mode = 0666


user = mbeck
group = mbeck

pm = dynamic
pm.max_children = 100
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 10
pm.max_requests = 1000

Hier möchte ich zeigen wie man relative URLs mit JavaScript realisieren kann.
Oft ist ein Projekt nicht immer unter der selben Relativen URL erreichbar, vor allem während der Entwicklung

Zum Beispiel:

Hier ein Code Beispiel, wie man Relative URLs mit Javascript realisieren kann:

Im Beispiel werden Kohana und jQuery genutzt.

< !DOCTYPE html>
<html lang="en">
    <head>
        <base href="<?php echo URL::Base(); ?/>" />
    </head>
    <body>
        <div id="content"></div>
 
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
        <script type="text/javascript">
            $.url = function(url) {
                return $('base').attr('href')+url.substr(1);
            }
            $('#content').get($.url('/account/login'));
        </script>
    </body>
</html>