Guest User

Untitled

a guest
Jul 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. sudo nano /etc/nginx/sites-available/default
  2.  
  3. Меняем содержимое на:
  4. !!!Меняем путь в root
  5.  
  6.  
  7. server{
  8. charset utf-8;
  9. client_max_body_size 128M;
  10.  
  11. listen 80;
  12.  
  13. server_name backend.dev;
  14. #root /var/www/yii/project/backend/web;
  15. root /var/www/yii/crm_2.3/frontend/web;
  16. #root /var/www/yii/crm_2.3/backend/web;
  17. index index.php;
  18.  
  19. access_log /var/log/nginx/access.log;
  20. error_log /var/log/nginx/error.log;
  21.  
  22. location / {
  23. try_files $uri $uri/ /index.php?$args;
  24. }
  25.  
  26. include /etc/nginx/php.conf;
  27.  
  28. location ~* .(jpg|jpeg|gif|png|css|js|ico|xml)$ {
  29. access_log off;
  30. log_not_found off;
  31. expires off;
  32. }
  33.  
  34. location ~ /.(ht|svn|git) {
  35. access_log off;
  36. log_not_found off;
  37. deny all;
  38. }
  39. }
  40.  
  41.  
  42. Создаем файл /etc/nginx/php.conf:
  43. sudo touch /etc/nginx/php.conf
  44.  
  45. Добавляем в него содержимое:
  46.  
  47. sudo nano/etc/nginx/php.conf
  48.  
  49.  
  50. location ~ .php$ {
  51. include fastcgi_params;
  52. #fastcgi_pass 127.0.0.1:9000;
  53. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  54. #fastcgi_pass unix:/run/php5-fpm.sock;
  55. fastcgi_read_timeout 3000;
  56.  
  57.  
  58. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  59. fastcgi_buffers 16 16k;
  60. fastcgi_buffer_size 32k;
  61. }
Add Comment
Please, Sign In to add comment