Last active
December 27, 2015 22:09
-
-
Save nghuuphuoc/7397282 to your computer and use it in GitHub Desktop.
Install Nginx on Centos 6
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
$ 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 |
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
# /etc/nginx/nginx.conf | |
http { | |
server_names_hash_bucket_size 64; | |
access_log off; | |
... | |
} |
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
--- /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