Advertisement
Guest User

nginx.conf

a guest
Feb 27th, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.71 KB | None | 0 0
  1. # For more information on configuration, see:
  2. #   * Official English Documentation: http://nginx.org/en/docs/
  3. #   * Official Russian Documentation: http://nginx.org/ru/docs/
  4.  
  5. user nginx;
  6. worker_processes auto;
  7. error_log /var/log/nginx/error.log;
  8. pid /run/nginx.pid;
  9.  
  10. # Load dynamic modules. See /usr/share/nginx/README.dynamic.
  11. include /usr/share/nginx/modules/*.conf;
  12.  
  13. events {
  14.     worker_connections 1024;
  15. }
  16.  
  17. http {
  18.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  19.                       '$status $body_bytes_sent "$http_referer" '
  20.                       '"$http_user_agent" "$http_x_forwarded_for"';
  21.  
  22.     access_log  /var/log/nginx/access.log  main;
  23.  
  24.     sendfile            on;
  25.     tcp_nopush          on;
  26.     tcp_nodelay         on;
  27.     keepalive_timeout   65;
  28.     types_hash_max_size 2048;
  29.  
  30.     include             /etc/nginx/mime.types;
  31.     default_type        application/octet-stream;
  32.  
  33.     # Load modular configuration files from the /etc/nginx/conf.d directory.
  34.     # See http://nginx.org/en/docs/ngx_core_module.html#include
  35.     # for more information.
  36.     include /etc/nginx/conf.d/*.conf;
  37.  
  38.     #server {
  39.     #    listen       80 default_server;
  40.     #    listen       [::]:80 default_server;
  41.     #    server_name  _;
  42.     #    root         /usr/share/nginx/html;
  43.    
  44.     #    # Load configuration files for the default server block.
  45.     #    include /etc/nginx/default.d/*.conf;
  46.  
  47.     #    location / {
  48.     #    }
  49.  
  50.     #    error_page 404 /404.html;
  51.     #        location = /40x.html {
  52.     #    }
  53.  
  54.     #    error_page 500 502 503 504 /50x.html;
  55.     #        location = /50x.html {
  56.     #    }
  57.     #}
  58.  
  59.     server {
  60.         server_name mysite.com;
  61.         root /var/www/html/site;
  62.         index Default.aspx;
  63.         #This access log just shows error 500s on connect
  64.         access_log /var/log/nginx/mysite.com.access.log;
  65.  
  66.         location = /favicon.ico {
  67.                 log_not_found off;
  68.                 access_log off;
  69.         }
  70.  
  71.         location = /robots.txt {
  72.                 allow all;
  73.                 log_not_found off;
  74.                 access_log off;
  75.         }
  76.  
  77.         location / {
  78.                 try_files $uri $uri/ /Default.aspx;
  79.         }
  80.  
  81.         # Fighting with ImageCache? This little gem is amazing.
  82.         location ~ ^/sites/.*/files/imagecache/ {
  83.                 try_files $uri $uri/ @rewrite;
  84.         }
  85.  
  86.         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  87.                 expires max;
  88.                 log_not_found off;
  89.         }
  90.  
  91.         location ~ \.(aspx|asmx|ashx|asax|ascx|soap|rem|axd|cs|config|dll)$ {
  92.             fastcgi_pass   127.0.0.1:9000;
  93.             include        fastcgi_params;
  94.         }
  95.     }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement