Advertisement
akhfa

vhost nginx

Aug 12th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name <domain> www.<domain>;
  4.  
  5. # auth_basic "Restricted Access";
  6. # auth_basic_user_file /etc/nginx/account/<domain>.users;
  7.  
  8. root /var/www/<domain>/public_html/;
  9. index index.php index.html index.htm;
  10.  
  11. location / {
  12. try_files $uri $uri/ /index.php?q=$uri&$args;
  13. }
  14.  
  15. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  16. #
  17. location ~ \.php$ {
  18. fastcgi_pass unix:/var/run/php5-fpm.sock;
  19. fastcgi_index index.php;
  20. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  21. include fastcgi_params;
  22. fastcgi_buffer_size 128k;
  23. fastcgi_buffers 256 4k;
  24. fastcgi_busy_buffers_size 256k;
  25. fastcgi_temp_file_write_size 256k;
  26. }
  27.  
  28. # deny access to .htaccess files, if Apache's document root
  29. # concurs with nginx's one
  30. #
  31. location ~ /\.ht {
  32. deny all;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement