Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.64 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         listen [::]:80;
  4.  
  5.         server_name ekb-news.ru;
  6.  
  7.         root /var/www/ekb-news.ru/www;
  8.         index index.php index.html index.htm;
  9.  
  10.         access_log /var/www/ekb-news.ru/logs/access.log;
  11.         error_log  /var/www/ekb-news.ru/logs/error.log;
  12.  
  13.         location / {
  14.                 try_files $uri $uri/ /index.php?$args;
  15.         }
  16.  
  17.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  18.  
  19.         location ~ \.php$ {
  20.                include snippets/fastcgi-php.conf;
  21.  
  22.                # With php5-cgi alone:
  23.         #       fastcgi_pass 127.0.0.1:9000;
  24.                # With php5-fpm:
  25.                fastcgi_pass unix:/var/run/php5-fpm.sock;
  26.         }
  27.  
  28.         # Запрещаем доступ к файлам, имя которых начинается с точки
  29.         location ~ /\. {
  30.                 deny all;
  31.         }
  32.  
  33.         # Запрещаем доступ к файлам, путь к которым соответствует следующим критериям:
  34.         location ~ /protected/ {
  35.                 return 444;
  36.         }
  37.  
  38.         # Файлы тем (вьюшки), так же не доступны для чтения:
  39.         location ~ ^/themes/(.*)/views/ {
  40.                 return 444;
  41.         }
  42.  
  43.         # deny access to .htaccess files, if Apache's document root
  44.         # concurs with nginx's one
  45.         #
  46.         location ~ /\.ht {
  47.                deny all;
  48.         }
  49. }
  50.  
  51. server {
  52.         listen 80;
  53.         listen [::]:80;
  54.  
  55.         server_name www.ekb-news.ru;
  56.         return 301 $scheme://ekb-news.ru$request_uri;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement