user nginx;
worker_processes 10;
worker_rlimit_nofile 65535;
error_log /var/log/nginx/error.log error;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
http {
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 off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 3;
types_hash_max_size 5120;
client_body_timeout 12;
client_header_timeout 12;
send_timeout 10;
gzip on;
gzip_disable "msie6";
gzip_vary on;
#gzip_min_length 10240;
#gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
client_body_buffer_size 128K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name xxxxxx.com;
rewrite ^/xxxx/$
http://yyyyy/ permanent;
rewrite ^/xxxx/$
http://yyyyy/ permanent;
root /var/www/xxxxx;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404-redirect.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
#fastcgi_param PHP_VALUE 128M
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
include fastcgi_params;
fastcgi_read_timeout 300;
}
location ~ /\.(ht|ssh) {
deny all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 360d;
log_not_found off;
access_log off;
}
}