Created
September 17, 2012 03:59
-
-
Save phalcon/3735467 to your computer and use it in GitHub Desktop.
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
http { | |
include mime.types; | |
default_type application/octet-stream; | |
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
# '$status $body_bytes_sent "$http_referer" ' | |
# '"$http_user_agent" "$http_x_forwarded_for"'; | |
#access_log /var/log/nginx/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
#gzip on; | |
server { | |
listen 80; | |
server_name localhost; | |
#charset koi8-r; | |
charset utf-8; | |
#access_log /var/log/nginx/host.access.log main; | |
location / { | |
root /srv/www/htdocs/phalconphp/public; | |
index index.php index.html index.htm; | |
#if file exists return it right away | |
if (-f $request_filename) { | |
break; | |
} | |
# otherwise rewrite the fucker | |
if (!-e $request_filename) { | |
rewrite ^(.+)$ /index.php?_url=$1 last; | |
break; | |
} | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /srv/www/htdocs/; | |
} | |
location ~ ^/index.php { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME /srv/www/htdocs/phalconphp/public$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
#location ~ /\.ht { | |
# deny all; | |
#} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment