####################################################### ### nginx compact basic configuration start ####################################################### ### ### Deny crawlers. ### if ($is_crawler) { return 403; } ### ### Include high load protection config if exists. ### include /data/conf/nginx_high_load.c*; ### ### Add recommended HTTP headers ### add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block" always; ### ### Catch all unspecified requests. ### location / { try_files $uri @dynamic; } ### ### Send all not cached requests to php-fpm with clean URLs support. ### location @dynamic { rewrite ^/(.*)$ /index.php last; } ### ### Send all non-static requests to php-fpm. ### location ~ \.php$ { try_files $uri =404; ### check for existence of php file first fastcgi_pass 127.0.0.1:9090; } ### ### Serve & no-log static files & images directly. ### location ~* ^.+\.(?:css|js|htc|xml|jpe?g|gif|png|ico|bmp|svg|swf|pdf|docx?|xlsx?|tiff?|txt|rtf|vcard|vcf|cgi|bat|pl|dll|aspx?|class|otf|ttf|woff2?|eot|less)$ { access_log off; expires 30d; try_files $uri =404; } ### ### Serve & log bigger media/static/archive files directly. ### location ~* ^.+\.(?:avi|mpe?g|mov|wmv|mp3|ogg|ogv|wav|midi|zip|tar|t?gz|rar|dmg|exe|apk|pxl|ipa)$ { expires 30d; try_files $uri =404; } ### ### Pseudo-streaming server-side support for Flash Video (FLV) files. ### location ~* ^.+\.flv$ { flv; expires 30d; try_files $uri =404; } ### ### Pseudo-streaming server-side support for H.264/AAC files. ### location ~* ^.+\.(?:mp4|m4a)$ { mp4; mp4_buffer_size 1m; mp4_max_buffer_size 5m; expires 30d; try_files $uri =404; } ####################################################### ### nginx compact basic configuration end #######################################################