Advertisement
Guest User

nginx

a guest
Mar 13th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.00 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.        
  4.  
  5.         root /var/www/html;
  6.  
  7.         # Add index.php to the list if you are using PHP
  8.         index index.php index.html index.htm index.nginx-debian.html;
  9.  
  10.         server_name somename.ru www.somename.ru;
  11.         charset  utf-8;
  12.  
  13.  
  14. location ~ \.(html|png|gif|jpg|woff|ttf|svg|ico|map|json|docx|log)$ {
  15.             root /var/www/html/img;
  16.       expires 1h;
  17.         }
  18. location ~* ^.+\.(js|json)$ {
  19.             root /var/www/html/js;
  20.       expires 1h;
  21.         }
  22. location ~* ^.+\.(css|saas|sass)$ {
  23.             alias /var/www/html/css;
  24.       expires 1h;
  25.         }
  26.  
  27. location / {
  28.                 try_files $uri /index.php$is_args$args;
  29.         }
  30.  
  31. location ~ ^/index\.php(/|$) {
  32.         fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
  33.         fastcgi_split_path_info ^(.+\.php)(/.*)$;
  34.         include fastcgi_params;
  35.  
  36.         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  37.         fastcgi_param DOCUMENT_ROOT $realpath_root;
  38.         internal;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement