Advertisement
safetypin

main nginx config

May 3rd, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.55 KB | None | 0 0
  1.  
  2. user www-data;
  3. worker_processes 4;
  4.  
  5. #error_log  logs/error.log;
  6. #error_log  logs/error.log  notice;
  7. #error_log  logs/error.log  info;
  8.  
  9. #pid        logs/nginx.pid;
  10.  
  11.  
  12. events {
  13.     worker_connections  1024;
  14. }
  15.  
  16.  
  17. http {
  18.     passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
  19.     passenger_ruby /usr/local/rbenv/shims/ruby;
  20.     #passenger_ruby /usr/bin/ruby1.9.1;
  21.  
  22.     include       mime.types;
  23.     default_type  application/octet-stream;
  24.  
  25.     ##
  26.     # Basic Settings
  27.     ##
  28.  
  29.     sendfile on;
  30.     tcp_nopush on;
  31.     tcp_nodelay on;
  32.     keepalive_timeout 65;
  33.     types_hash_max_size 2048;
  34.     # server_tokens off;
  35.     client_max_body_size 100m;
  36.  
  37.     ##                                                                                                                    
  38.     # Gzip Settings                                                                                                      
  39.     ##                                                                                                                    
  40.                                                                                                                        
  41.     gzip on;                                                                                                              
  42.     gzip_disable "msie6";                                                                                                
  43.  
  44.     server {
  45.         listen       80;
  46.         server_name  localhost;
  47.  
  48.         #charset koi8-r;
  49.  
  50.         #access_log  logs/host.access.log  main;
  51.  
  52.         location / {
  53.             root   html;
  54.             index  index.html index.htm;
  55.         }
  56.  
  57.         #error_page  404              /404.html;
  58.  
  59.         # redirect server error pages to the static page /50x.html
  60.         #
  61.         error_page   500 502 503 504  /50x.html;
  62.         location = /50x.html {
  63.             root   html;
  64.         }
  65.  
  66.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  67.         #
  68.         #location ~ \.php$ {
  69.         #    proxy_pass   http://127.0.0.1;
  70.         #}
  71.  
  72.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  73.         #
  74.         #location ~ \.php$ {
  75.         #    root           html;
  76.         #    fastcgi_pass   127.0.0.1:9000;
  77.         #    fastcgi_index  index.php;
  78.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  79.         #    include        fastcgi_params;
  80.         #}
  81.  
  82.         # deny access to .htaccess files, if Apache's document root
  83.         # concurs with nginx's one
  84.         #
  85.         #location ~ /\.ht {
  86.         #    deny  all;
  87.         #}
  88.     }
  89.     include /etc/nginx/sites-enabled/*;                                                                                  
  90.  
  91.  
  92.     # another virtual host using mix of IP-, name-, and port-based configuration
  93.     #
  94.     #server {
  95.     #    listen       8000;
  96.     #    listen       somename:8080;
  97.     #    server_name  somename  alias  another.alias;
  98.  
  99.     #    location / {
  100.     #        root   html;
  101.     #        index  index.html index.htm;
  102.     #    }
  103.     #}
  104.  
  105.  
  106.     # HTTPS server
  107.     #
  108.     #server {
  109.     #    listen       443 ssl;
  110.     #    server_name  localhost;
  111.  
  112.     #    ssl_certificate      cert.pem;
  113.     #    ssl_certificate_key  cert.key;
  114.  
  115.     #    ssl_session_cache    shared:SSL:1m;
  116.     #    ssl_session_timeout  5m;
  117.  
  118.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  119.     #    ssl_prefer_server_ciphers  on;
  120.  
  121.     #    location / {
  122.     #        root   html;
  123.     #        index  index.html index.htm;
  124.     #    }
  125.     #}
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement