Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. server {
  2. charset utf-8;
  3. client_max_body_size 20m;
  4. client_body_buffer_size 128k;
  5. fastcgi_hide_header Set-Cookie;
  6. gzip on;
  7. gzip_min_length 1000;
  8. gzip_buffers 16 8k;
  9. gzip_comp_level 9;
  10. gzip_types text/plain application/x-javascript application/javascript text/xml text/css image/svg+xml image/jpeg;
  11. gzip_vary on;
  12. location ~* \.(css|js|jpg|jpeg|gif|ico|png|bmp|pict|csv|doc|pdf|pls|ppt|tif|tiff|eps|ejs|swf|midi|mid|ttf|eot|woff|otf|svg|svgz|webp|docx|xlsx|xls|pptx|ps|class|jar|woff2|less|scss|svg+xml)$ {
  13. add_header 'Access-Control-Allow-Origin' '*';
  14. access_log off;
  15. log_not_found off;
  16. expires 360d;
  17. }
  18. root /var/www/html;
  19. index index.html index.php;
  20.  
  21.  
  22. server_name _;
  23.  
  24.  
  25. location / {
  26. index index.html index.php;
  27. if (!-e $request_filename){
  28. rewrite ^/(.*) /index.php?r=$1 last;
  29. }
  30. if ($request_filename ~ "\.(css|js|jpg|jpeg|gif|ico|png|bmp|pict|csv|doc|pdf|pls|ppt|tif|tiff|eps|ejs|swf|midi|mid|ttf|eot|woff|otf|svg|svgz|webp|docx|xlsx|xls|pptx|ps|class|jar|woff2|less|scss|svg)$") {
  31. add_header Pragma "public";
  32. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  33. add_header Access-Control-Allow-Origin *;
  34. access_log off;
  35. expires 360d;
  36. break;
  37. }
  38. location ~ ^/assets/.+\.php(/|$) {
  39. deny all;
  40. }
  41. }
  42.  
  43. location ~ \.php$ {
  44. include snippets/fastcgi-php.conf;
  45. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  46.  
  47. }
  48. location ~ /\.ht {
  49. deny all;
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement