nginx configuration - RIAua/RestlerSkeleton GitHub Wiki
/etc/nginx/conf.d/skeleton.conf
#mkdir -p /var/spool/nginx/cache/rest_album_fcgi
fastcgi_cache_path /var/spool/nginx/cache/rest_album_fcgi levels=2:2 keys_zone=rest_album_fcgi:1024m;
#fastcgi_cache_key "$uri$is_args$args#$http_range";
server {
listen 80;
server_name restler-skeleton.local-ria.ua;
fastcgi_cache_key "$uri$is_args$args#$http_range";
root /var/www/github/RestlerSkeleton/public/;
#fastcgi_cache_key "$uri$is_args$args#$http_range";
ssi off;
location / {
include fastcgi.restler_skeleton.conf;
#fastcgi_cache_key "$uri$is_args$args#$http_range";
#fastcgi_pass localhost:9000;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_cache rest_album_fcgi;
fastcgi_cache_min_uses 1;
fastcgi_cache_valid 24h;
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
fastcgi_ignore_client_abort on;
fastcgi_cache_lock on;
fastcgi_cache_lock_timeout 10s;
# fastcgi_param APPLICATION_ENV development;
# fastcgi_param APPLICATION_ENV production;
# fastcgi_param RESTLER_PATH /var/www/github/Restler/restler/;
# fastcgi_param RESTLER_PATH /var/www/restler/restler/;
}
location /css/ { }
location /images/ { }
location /js/ { }
location = /favicon.ico {
access_log off;
deny all;
}
location ~ /cache_del_album(/.*) {
fastcgi_cache_purge rest_album_fcgi $1$is_args$args#$http_range;
access_log /var/log/nginx/rest/cache_purge_album_rest_access.log;
}
access_log /var/log/nginx/rest/restler_main_rest_access.log main;
error_log /var/log/nginx/rest/restler_main_rest_error.log;
}
/etc/nginx/fastcgi.restler_skeleton.conf
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
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 SCRIPT_NAME "/index.php";
#fastcgi_param REQUEST_URI $request_uri;
fastcgi_param REQUEST_URI $uri?$args;
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;