Created
May 3, 2012 14:54
-
-
Save mindo/2586240 to your computer and use it in GitHub Desktop.
nginx config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name ~^(.+).dev$; | |
if ($host ~ "^(.+).dev") { | |
set $site $1; | |
} | |
root /var/www/$site/web; | |
client_max_body_size 10M; | |
access_log /var/log/nginx/demo.access_log; | |
error_log /var/log/nginx/demo.error_log; | |
rewrite ^/admin(.*)$ /admin.php last; | |
# rewrite ^([^.]*[^/])$ $1/ permanent; | |
location ~ /(admin|company|ajax|cv|receipt|profile)/$ { | |
rewrite ^([^.]*)/$ $1 last; | |
} | |
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ { | |
expires max; | |
access_log off; | |
} | |
location / { | |
set $idx app.php; | |
if ( -f $document_root/index.php ) { | |
set $idx index.php; | |
} | |
index $idx; | |
try_files $uri $uri/ /$idx$uri?$args; | |
} | |
location ^~ /sf/ { | |
expires max; | |
access_log off; | |
alias /var/lib/symfony/1.4/data/web/sf/; | |
} | |
location ~ "^(.+\.php)($|/)" { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
#fastcgi_pass 127.0.0.1:9000; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index $idx; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_param HTTPS off; | |
include fastcgi_params; | |
} | |
# add_header "X-UA-Compatible" "IE=Edge,chrome=1"; | |
# location ~ /\.ht { | |
# deny all; | |
# } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
# server_tokens off; | |
# server_names_hash_bucket_size 64; | |
# server_name_in_redirect off; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
## | |
# Logging Settings | |
## | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
## | |
# Gzip Settings | |
## | |
gzip on; | |
gzip_disable "msie6"; | |
# gzip_vary on; | |
# gzip_proxied any; | |
# gzip_comp_level 6; | |
# gzip_buffers 16 8k; | |
# gzip_http_version 1.1; | |
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
## | |
# nginx-naxsi config | |
## | |
# Uncomment it if you installed nginx-naxsi | |
## | |
#include /etc/nginx/naxsi_core.rules; | |
## | |
# nginx-passenger config | |
## | |
# Uncomment it if you installed nginx-passenger | |
## | |
#passenger_root /usr; | |
#passenger_ruby /usr/bin/ruby; | |
## | |
# Virtual Host Configs | |
## | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment