Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
Last active December 27, 2015 22:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nghuuphuoc/7397282 to your computer and use it in GitHub Desktop.
Save nghuuphuoc/7397282 to your computer and use it in GitHub Desktop.
Install Nginx on Centos 6
$ rpm -Uvh http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.4.7-1.el6.ngx.x86_64.rpm
$ chkconfig --add nginx
$ chkconfig --levels 235 nginx on
# /etc/nginx/nginx.conf
http {
server_names_hash_bucket_size 64;
access_log off;
...
}
--- /etc/nginx/mime.types ---
types {
# Add the following lines
font/ttf ttf;
font/opentype otf;
application/font-woff woff;
application/vnd.ms-fontobject eot;
# Remove this line
# application/octet-stream eot;
}
--- /etc/nginx/conf.d/yoursite.conf ---
server {
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment