Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. charset UTF-8;
  5. access_log /logs/localhost/nginx_access_log;
  6. error_log /logs/localhost/nginx_error_log;
  7.  
  8. root /www/localhost/http;
  9. index index.php index.html index.htm index.nginx-debian.html;
  10.  
  11. server_name localhost;
  12.  
  13. location / {
  14. try_files $uri $uri/ =404;
  15. }
  16.  
  17. location ~ .php {
  18. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  19. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  20. include fastcgi_params;
  21. }
  22.  
  23. location ~* .(jpeg|jpg|gif|png|css|js|pdf|txt|tar|rar|zip|exe|mkv|iso|avi|mp4)$ {
  24. expires 1y;
  25. if_modified_since before;
  26. root /www/localhost/http;
  27. access_log off;
  28. }
  29. location @deny {
  30. deny all;
  31. }
  32. }
  33. ~
  34.  
  35. 'urlManager'=>array(
  36. 'urlFormat'=>'path',
  37. 'showScriptName' => false,
  38. 'enableStrictParsing' => false,
  39. 'rules'=>array(
  40. // Главная
  41. '' => 'site/index',
  42.  
  43. 'test' => 'site/test',
  44.  
  45. // Логин
  46. '<_c:(login|register|logout|lost)>' => 'user/<_c>',
  47.  
  48. // Поиск
  49. 'search/<page:d+>' => 'site/search',
  50. 'search' => 'site/search',
  51.  
  52. // Сертификат
  53. '/certificate.html' => 'site/certificate',
  54.  
  55. // Конкурс
  56. 'contest' => 'contest/index',
  57. 'contest/request' => 'contest/request',
  58.  
  59. // Новости
  60. 'news' => 'site/news',
  61. 'news/page/<page:d+>' => 'site/news',
  62.  
  63. // В помощь
  64. 'help' => 'help/index',
  65. 'help/page/<page:d+>' => 'help/index',
  66. 'help/<id:d+>-<post_url>.html' => 'help/post',
  67.  
  68. // ФГОС
  69. 'fgos' => 'fgos/index',
  70. 'fgos/<parent:[a-z0-9-_]+>/<child:[a-z0-9-_]+>/' => 'fgos/category',
  71. 'fgos/<parent:[a-z0-9-_]+>/<child:[a-z0-9-_]+>/page/<page:d+>' => 'fgos/category',
  72.  
  73. // Страница
  74. '<page_url:[a-z0-9-_]+>.html' => 'site/page',
  75.  
  76. // Пост
  77. '<id:d+>' => 'publications/post',
  78. '<id:d+>/download/' => 'publications/download',
  79. '<id:d+>/certificate/' => 'publications/certificate',
  80. '<post_id:d+>/diplom/<author_id:d+>' => 'publications/diplom',
  81. 'download/<id:d+>' => 'site/download',
  82. 'rate/<post_id:d+>/<direction:(plus|minus)>' => 'site/rate',
  83.  
  84. // Пользователь
  85. 'user/<username>' => 'user/info',
  86. 'favorites' => 'user/favorites',
  87. 'favorites/page/<page:d+>' => 'user/favorites',
  88.  
  89. // Добавит материал
  90. 'add' => 'publications/add',
  91. 'add/file' => 'publications/addfile',
  92. 'add/preview' => 'publications/addpreview',
  93.  
  94. // Админка
  95. 'admin' => 'admin/index',
  96.  
  97. // Категория
  98. 'publications' => 'publications/index',
  99. 'tags' => 'publications/tags',
  100. '<category_url:[a-z0-9-_]+>/page/<page:d+>' => 'publications/category',
  101. '<category_url:[a-z0-9-_]+>' => 'publications/category',
  102. ),
  103. ),
  104.  
  105. root /www/localhost/http;
  106.  
  107. root /www/localhost/framework/web;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement