Haikson

separate directories

Apr 13th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.42 KB | None | 0 0
  1. server {
  2.     listen      80;
  3.     server_name mydomain.ru;
  4.     charset     utf8;
  5.     autoindex   off;
  6.     access_log  /srv/logs/mydomain.ru_access.log;
  7.     error_log   /srv/logs/mydomain.ru_error.log error;
  8.  
  9.     set         $project_home       /srv/www/mydomain.ru;
  10.     set         $media_home      /srv/www/httpdocs;
  11.  
  12.     root        $project_home;
  13.  
  14.  
  15.     location / {
  16.         root            $project_home;
  17.         try_files       $uri    @webadm;
  18.     }
  19.  
  20.     location ~* ^/(images|img|css|js|fonts|files) {
  21.         root          $media_home/media;
  22.         expires       1w;
  23.     }
  24.  
  25.     location ~* ^/(media|static) {
  26.         root            $media_home;
  27.         expires         1w;
  28.     }
  29.  
  30.     gzip             on;
  31.     gzip_min_length  1000;
  32.     gzip_proxied     expired no-cache no-store private auth;
  33.     gzip_disable     "MSIE [1-6]\.(?!.*SV1)";
  34.     gzip_static      on;
  35.     gzip_types       text/plain application/xml text/css application/javascript application/x-javascript text/javascript application/x-woff image/gif image/jpeg image/pjpeg image/png;
  36.  
  37.     location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|css|js)$ {
  38.         expires 7d;
  39.     }
  40.  
  41.     location @webadm {
  42.         uwsgi_pass              wsgi_mydomain.ru;
  43.         uwsgi_read_timeout      2400;
  44.         include                 uwsgi_params;
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment