Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ************** nginx.conf **********
- user nginx;
- worker_processes auto;
- error_log /var/log/nginx/error.log;
- pid /var/run/nginx.pid;
- events {
- worker_connections 1024;
- multi_accept on;
- use epoll;
- }
- worker_rlimit_nofile 40000;
- http {
- server_names_hash_bucket_size 64;
- include /etc/nginx/mime.types;
- 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;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 10;
- server_tokens off;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
- gzip_vary on;
- gzip_min_length 10240;
- gzip_proxied expired no-cache no-store private auth;
- gzip_disable "MSIE [1-6]\.";
- open_file_cache max=2000 inactive=20s;
- open_file_cache_valid 60s;
- open_file_cache_min_uses 5;
- open_file_cache_errors off;
- real_ip_header X-Forwarded-For;
- real_ip_header proxy_protocol;
- real_ip_recursive on;
- set_real_ip_from xxx.xxx.xxx.xxx;
- # enabled sites
- include /etc/nginx/sites-enabled/*;
- }
- **************** sites-enabled.conf *************
- server {
- listen 80;
- server_name localhost;
- access_log logs/access.log combined;
- root /server/webdev/www/xxx;
- index index.html index.htm index.php;
- ### root directory ###
- set $skip_cache 1;
- include /etc/nginx/rewrite.conf.d/xxx.conf;
- ### security ###
- #error_page 403 = 404;
- ### php block ###
- location /home/giftcode {
- try_files $uri $uri/ /home/index.php$is_args$args;
- }
- location ~ \.php?$ {
- try_files $uri =404;
- include fastcgi_params;
- fastcgi_pass unix:/var/run/php-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_intercept_errors on;
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- #Prevent version info leakage
- fastcgi_hide_header X-Powered-By;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 16k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- }
- location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
- access_log off;
- log_not_found off;
- expires max;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement