Advertisement
Guest User

Untitled

a guest
Mar 14th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user vagrant;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log crit;
  4. pid /var/run/nginx.pid;
  5.  
  6. include /usr/share/nginx/modules/*.conf;
  7.  
  8. events {
  9.     worker_connections 1024;
  10. }
  11.  
  12. http {
  13.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  14.                       '$status $body_bytes_sent "$http_referer" '
  15.                       '"$http_user_agent" "$http_x_forwarded_for"';
  16.  
  17.     access_log  /var/log/nginx/access.log  main;
  18.  
  19.     sendfile            on;
  20.     tcp_nopush          on;
  21.     tcp_nodelay         on;
  22.     keepalive_timeout   65;
  23.     types_hash_max_size 2048;
  24.  
  25.     include             /etc/nginx/mime.types;
  26.     default_type        application/octet-stream;
  27.  
  28.     server {
  29.         listen       80;
  30.         listen       [::]:80;
  31.         server_name  _;
  32.         root         /usr/share/nginx/html;
  33.  
  34.         location / {
  35.         }
  36.  
  37.         error_page 404 /404.html;
  38.             location = /40x.html {
  39.         }
  40.  
  41.         error_page 500 502 503 504 /50x.html;
  42.             location = /50x.html {
  43.         }
  44.     }
  45.    
  46.     server {
  47.         listen      80;
  48.         server_name ap-office.test www.ap-office.test *.ap-office.test;
  49.         root        /app/ap-office.test;
  50.         index       index.php index.html index.htm;
  51.        
  52.         access_log  /app/vagrant/nginx/log/ap-office.test.log;
  53.         error_log   /app/vagrant/nginx/log/ap-office.test.log;
  54.        
  55.         location / {
  56.             location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  57.                 expires     max;
  58.             }
  59.  
  60.             location ~ \.php$ {
  61.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  62.                 if (!-f $document_root$fastcgi_script_name) {
  63.                     return  404;
  64.                 }
  65.  
  66.                 fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  67.                 include         /etc/nginx/fastcgi_params;
  68.             }
  69.         }
  70.        
  71.         location ~* "/\.(htaccess|htpasswd)$" {
  72.             deny    all;
  73.             return  404;
  74.         }
  75.        
  76.         location ~ /\.(ht|svn|git) {
  77.            deny all;
  78.        }
  79.     }
  80.  
  81.    
  82.     #include /etc/nginx/conf.d/*.conf;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement