Guest User

Untitled

a guest
Jun 18th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #Для фреймворков - стандартный
  2. server {
  3. server_name [название];
  4. root [путь];
  5. index index.html index.php;
  6. location /
  7. {
  8. try_files $uri $uri/ /index.php?$args;
  9. }
  10. location ~ \.php$
  11. {
  12. try_files $uri =404;
  13. fastcgi_index index.php;
  14. fastcgi_pass 127.0.0.1:9000;
  15. include fastcgi_params;
  16. fastcgi_param SCRIPT_FILENAME $request_filename;
  17. }
  18. }
  19.  
  20.  
  21. #Для автоматического поиска root директории
  22. server {
  23. server_name ~^(?:www\.)?(?P<host_wo_www>.+)$;
  24. root [путь]/$host_wo_www;
  25. index index.html index.php; #fix 403 error
  26. location / {
  27. try_files $uri $uri/ /index.php?$args;
  28. }
  29. location ~ \.php$ {
  30. try_files $uri =404;
  31. fastcgi_index index.php;
  32. fastcgi_pass 127.0.0.1:9000; # Сокет либо порт для Unix систем
  33. #fastcgi_pass unix:/path
  34. include fastcgi_params;
  35. fastcgi_param SCRIPT_FILENAME $request_filename;
  36. }
  37. }
Add Comment
Please, Sign In to add comment