Skip to content

Instantly share code, notes, and snippets.

@jsifalda
Created August 12, 2012 12:21
Show Gist options
  • Save jsifalda/3331643 to your computer and use it in GitHub Desktop.
Save jsifalda/3331643 to your computer and use it in GitHub Desktop.
Nette nginx configuration
# Please paste to folder common/common.conf
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }
location ~ /\.(ht|gitignore) { # deny access to .htaccess files, if Apache's document root concurs with nginx's one
deny all;
}
location ~ \.(neon|ini|log|yml)$ { # deny access to configuration files
deny all;
}
location = /robots.txt { access_log off; log_not_found off; }
location = /humans.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
fastcgi_buffers 8 16k; fastcgi_buffer_size 32k;
client_max_body_size 45M;
client_body_buffer_size 128k;
# Please paste to folder common/nette.conf
try_files $uri $uri/ /index.php?$args;
#user www-data www-data;
worker_processes 2;
error_log /usr/local/var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 560;
autoindex on;
client_max_body_size 20M;
gzip on;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 80;
server_name localhost;
root /Users/jsifalda/nginx/;
include common/common.conf;
include common/php.conf;
include common/nette.conf;
}
include sites-enabled/*.conf;
}
# Please paste to folder common/php.conf
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_connect_timeout 1800;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment