Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user http http;
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- gzip on;
- gzip_comp_level 5;
- # Don't compress anything that's already small and unlikely to shrink much
- # if at all (the default is 20 bytes, which is bad as that usually leads to
- # larger files after gzipping).
- gzip_min_length 256;
- # Compress data even for clients that are connecting to us via proxies,
- # identified by the "Via" header (required for CloudFront).
- gzip_proxied any;
- # Tell proxies to cache both the gzipped and regular version of a resource
- # whenever the client's Accept-Encoding capabilities header varies;
- # Avoids the issue where a non-gzip capable client (which is extremely rare
- # today) would display gibberish if their proxy gave them the gzipped version.
- gzip_vary on;
- # Compress all output labeled with one of the following MIME-types.
- gzip_types
- application/atom+xml
- application/javascript
- application/json
- application/ld+json
- application/manifest+json
- application/rss+xml
- application/vnd.geo+json
- application/vnd.ms-fontobject
- application/x-font-ttf
- application/x-web-app-manifest+json
- application/xhtml+xml
- application/xml
- font/opentype
- image/bmp
- image/svg+xml
- image/x-icon
- text/cache-manifest
- text/css
- text/plain
- text/vcard
- text/vnd.rim.location.xloc
- text/vtt
- text/x-component
- text/x-cross-domain-policy;
- # text/html is always compressed by HttpGzipModule
- # This should be turned on if you are going to have pre-compressed copies (.gz) of
- # static files available. If not it should be left off as it will cause extra I/O
- # for the check. It is best if you enable this in a location{} block for
- # a specific directory, or on an individual server{} level.
- # gzip_static on;
- # Include files in the sites-enabled folder. server{} configuration files should be
- # placed in the sites-available folder, and then the configuration should be enabled
- # by creating a symlink to it in the sites-enabled folder.
- # See doc/sites-enabled.md for more info.
- include sites-enabled/*;
- server {
- listen 80;
- server_name www.dpt.dev dpt.dev;
- set $root_path '/usr/share/nginx/html/DPT';
- root $root_path;
- index index.php index.html index.htm;
- try_files $uri $uri/ @rewrite;
- location @rewrite {
- rewrite ^/(.*)$ /index.php?_url=/$1;
- }
- location ~ \.php {
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
- fastcgi_index /index.php;
- include /etc/nginx/fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
- root $root_path;
- }
- location ~ /\.ht {
- deny all;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement