×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Bash
Posted by: Paul Allies Allies
Added: Jul 6, 2012 2:15 PM
Modified: Jul 6, 2012 3:13 PM
Views: 1772
Tags: no tags
  1. //make sure the system is up to date
  2. $ sudo apt-get update
  3.  
  4. //Install nginx
  5. $ sudo apt-get install nginx
  6.  
  7. //Start nginx
  8. $ sudo /etc/init.d/nginx start
  9.  
  10. //Edit your /etc/nginx/nginx.conf file
  11. worker_processes  1;
  12. events {
  13.     worker_connections  1024;
  14. }
  15. http {
  16.         include mime.types;
  17.         sendfile on;
  18.         server{
  19.                 listen 8080;
  20.                 server_name localhost;
  21.                 location {
  22.                     root /opt/nginx/html;
  23.                     index  index.html index.htm;
  24.                 }
  25.         }
  26.         #gzip settings
  27.         gzip on;
  28.         gzip_http_version 1.1;
  29.         gzip_comp_level 2;
  30.         gzip_types text/plain text/css
  31.                       application/x-javascript text/xml
  32.                       application/xml application/xml+rss
  33.                       text/javascript;
  34. }