Skip to content

Instantly share code, notes, and snippets.

@oa414
Created March 2, 2014 05:47
Show Gist options
  • Select an option

  • Save oa414/9302510 to your computer and use it in GitHub Desktop.

Select an option

Save oa414/9302510 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name ;
large_client_header_buffers 4 32k;
#charset koi8-r;
error_log /var/log/nginx/log/host.error.log ;
access_log /var/log/nginx/log/host.access.log;
root /var/www/;
#autoindex on;
# ssl on;
# ssl_certificate /usr/local/etc/nginx/server.crt;
# ssl_certificate_key /usr/local/etc/nginx/server.key;
location /it-man {
if (!-f $request_filename){
rewrite (.*) /it-man/index.php;
}
}
location / {
index index.html index.htm index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
location ~ \.php$ {
include fastcgi_params;
index index.html index.htm;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
#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 html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# 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