Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- listen [::]:80;
- charset UTF-8;
- access_log /logs/localhost/nginx_access_log;
- error_log /logs/localhost/nginx_error_log;
- root /www/localhost/http;
- index index.php index.html index.htm index.nginx-debian.html;
- server_name localhost;
- location / {
- try_files $uri $uri/ =404;
- }
- location ~ .php {
- fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~* .(jpeg|jpg|gif|png|css|js|pdf|txt|tar|rar|zip|exe|mkv|iso|avi|mp4)$ {
- expires 1y;
- if_modified_since before;
- root /www/localhost/http;
- access_log off;
- }
- location @deny {
- deny all;
- }
- }
- ~
- 'urlManager'=>array(
- 'urlFormat'=>'path',
- 'showScriptName' => false,
- 'enableStrictParsing' => false,
- 'rules'=>array(
- // Главная
- '' => 'site/index',
- 'test' => 'site/test',
- // Логин
- '<_c:(login|register|logout|lost)>' => 'user/<_c>',
- // Поиск
- 'search/<page:d+>' => 'site/search',
- 'search' => 'site/search',
- // Сертификат
- '/certificate.html' => 'site/certificate',
- // Конкурс
- 'contest' => 'contest/index',
- 'contest/request' => 'contest/request',
- // Новости
- 'news' => 'site/news',
- 'news/page/<page:d+>' => 'site/news',
- // В помощь
- 'help' => 'help/index',
- 'help/page/<page:d+>' => 'help/index',
- 'help/<id:d+>-<post_url>.html' => 'help/post',
- // ФГОС
- 'fgos' => 'fgos/index',
- 'fgos/<parent:[a-z0-9-_]+>/<child:[a-z0-9-_]+>/' => 'fgos/category',
- 'fgos/<parent:[a-z0-9-_]+>/<child:[a-z0-9-_]+>/page/<page:d+>' => 'fgos/category',
- // Страница
- '<page_url:[a-z0-9-_]+>.html' => 'site/page',
- // Пост
- '<id:d+>' => 'publications/post',
- '<id:d+>/download/' => 'publications/download',
- '<id:d+>/certificate/' => 'publications/certificate',
- '<post_id:d+>/diplom/<author_id:d+>' => 'publications/diplom',
- 'download/<id:d+>' => 'site/download',
- 'rate/<post_id:d+>/<direction:(plus|minus)>' => 'site/rate',
- // Пользователь
- 'user/<username>' => 'user/info',
- 'favorites' => 'user/favorites',
- 'favorites/page/<page:d+>' => 'user/favorites',
- // Добавит материал
- 'add' => 'publications/add',
- 'add/file' => 'publications/addfile',
- 'add/preview' => 'publications/addpreview',
- // Админка
- 'admin' => 'admin/index',
- // Категория
- 'publications' => 'publications/index',
- 'tags' => 'publications/tags',
- '<category_url:[a-z0-9-_]+>/page/<page:d+>' => 'publications/category',
- '<category_url:[a-z0-9-_]+>' => 'publications/category',
- ),
- ),
- root /www/localhost/http;
- root /www/localhost/framework/web;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement