Advertisement
Guest User

config

a guest
Dec 4th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. user http http;
  2. worker_processes 1;
  3.  
  4.  
  5.  
  6. events {
  7. worker_connections 1024;
  8. }
  9.  
  10.  
  11. http {
  12. include mime.types;
  13. default_type application/octet-stream;
  14.  
  15.  
  16. sendfile on;
  17.  
  18. keepalive_timeout 65;
  19.  
  20. gzip on;
  21.  
  22. gzip_comp_level 5;
  23.  
  24. # Don't compress anything that's already small and unlikely to shrink much
  25. # if at all (the default is 20 bytes, which is bad as that usually leads to
  26. # larger files after gzipping).
  27. gzip_min_length 256;
  28.  
  29. # Compress data even for clients that are connecting to us via proxies,
  30. # identified by the "Via" header (required for CloudFront).
  31. gzip_proxied any;
  32.  
  33. # Tell proxies to cache both the gzipped and regular version of a resource
  34. # whenever the client's Accept-Encoding capabilities header varies;
  35. # Avoids the issue where a non-gzip capable client (which is extremely rare
  36. # today) would display gibberish if their proxy gave them the gzipped version.
  37. gzip_vary on;
  38.  
  39. # Compress all output labeled with one of the following MIME-types.
  40. gzip_types
  41. application/atom+xml
  42. application/javascript
  43. application/json
  44. application/ld+json
  45. application/manifest+json
  46. application/rss+xml
  47. application/vnd.geo+json
  48. application/vnd.ms-fontobject
  49. application/x-font-ttf
  50. application/x-web-app-manifest+json
  51. application/xhtml+xml
  52. application/xml
  53. font/opentype
  54. image/bmp
  55. image/svg+xml
  56. image/x-icon
  57. text/cache-manifest
  58. text/css
  59. text/plain
  60. text/vcard
  61. text/vnd.rim.location.xloc
  62. text/vtt
  63. text/x-component
  64. text/x-cross-domain-policy;
  65. # text/html is always compressed by HttpGzipModule
  66.  
  67. # This should be turned on if you are going to have pre-compressed copies (.gz) of
  68. # static files available. If not it should be left off as it will cause extra I/O
  69. # for the check. It is best if you enable this in a location{} block for
  70. # a specific directory, or on an individual server{} level.
  71. # gzip_static on;
  72.  
  73. # Include files in the sites-enabled folder. server{} configuration files should be
  74. # placed in the sites-available folder, and then the configuration should be enabled
  75. # by creating a symlink to it in the sites-enabled folder.
  76. # See doc/sites-enabled.md for more info.
  77. include sites-enabled/*;
  78.  
  79. server {
  80.  
  81. listen 80;
  82. server_name www.dpt.dev dpt.dev;
  83. set $root_path '/usr/share/nginx/html/DPT';
  84. root $root_path;
  85.  
  86. index index.php index.html index.htm;
  87.  
  88. try_files $uri $uri/ @rewrite;
  89.  
  90. location @rewrite {
  91. rewrite ^/(.*)$ /index.php?_url=/$1;
  92. }
  93.  
  94. location ~ \.php {
  95.  
  96. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  97. fastcgi_index /index.php;
  98.  
  99. include /etc/nginx/fastcgi_params;
  100.  
  101. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  102. fastcgi_param PATH_INFO $fastcgi_path_info;
  103. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  104. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  105. }
  106.  
  107. location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
  108. root $root_path;
  109. }
  110.  
  111. location ~ /\.ht {
  112. deny all;
  113. }
  114.  
  115. }
  116.  
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement