Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user nginx;
- worker_processes 8;
- error_log /var/log/nginx/error.log;
- pid /var/run/nginx.pid;
- worker_rlimit_nofile 32768;
- events {
- worker_connections 20000;
- use epoll;
- multi_accept on;
- }
- http {
- include /etc/nginx/mime.types;
- include /etc/nginx/fastcgi.conf;
- include /etc/nginx/proxy.conf;
- index index.html index.htm index.php;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log main;
- server_tokens off;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 2;
- reset_timedout_connection on;
- gzip on;
- gzip_buffers 16 8k;
- gzip_comp_level 1;
- gzip_http_version 1.1;
- gzip_min_length 10;
- gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon application/vnd.ms-fontobject font/opentype application/x-font-ttf;
- gzip_vary on;
- gzip_proxied any;
- gzip_disable "msie6";
- gzip_static on;
- server {
- listen 80;
- server_name _;
- server_name_in_redirect off;
- root /var/www/html;
- location / {
- error_page 404 /404;
- location ~* ^.+\.(?:css|js|jpe?g|gif|ico|png|html|xml)$ {
- log_not_found off;
- access_log off;
- expires 30d;
- tcp_nodelay off;
- open_file_cache max=3000 inactive=120s;
- open_file_cache_valid 45s;
- open_file_cache_min_uses 2;
- open_file_cache_errors off;
- }
- location ~* ^(?:.+\.(?:htaccess|make|txt|engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(?:\.php)?|xtmpl)|code-style\.pl|/Entries.*|/Repository|/Root|/Tag|/Template)$ {
- return 404;
- }
- try_files $uri $uri/ @proxy;
- }
- location @proxy {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- }
- location ^~ /.git {
- return 404;
- }
- location ~* ^.+\.php$ {
- return 404;
- }
- }
- # Load config files from the /etc/nginx/conf.d directory
- include /etc/nginx/conf.d/*.conf;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement