Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. ************** nginx.conf **********
  2.  
  3. user nginx;
  4. worker_processes auto;
  5.  
  6. error_log /var/log/nginx/error.log;
  7.  
  8.  
  9. pid /var/run/nginx.pid;
  10.  
  11. events {
  12. worker_connections 1024;
  13. multi_accept on;
  14. use epoll;
  15. }
  16.  
  17. worker_rlimit_nofile 40000;
  18.  
  19. http {
  20. server_names_hash_bucket_size 64;
  21. include /etc/nginx/mime.types;
  22. default_type application/octet-stream;
  23.  
  24. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  25. '$status $body_bytes_sent "$http_referer" '
  26. '"$http_user_agent" "$http_x_forwarded_for"';
  27.  
  28. access_log /var/log/nginx/access.log main;
  29.  
  30. sendfile on;
  31. tcp_nopush on;
  32. tcp_nodelay on;
  33. keepalive_timeout 10;
  34.  
  35. server_tokens off;
  36.  
  37.  
  38. 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;
  39. gzip_vary on;
  40. gzip_min_length 10240;
  41. gzip_proxied expired no-cache no-store private auth;
  42. gzip_disable "MSIE [1-6]\.";
  43.  
  44.  
  45. open_file_cache max=2000 inactive=20s;
  46. open_file_cache_valid 60s;
  47. open_file_cache_min_uses 5;
  48. open_file_cache_errors off;
  49.  
  50. real_ip_header X-Forwarded-For;
  51. real_ip_header proxy_protocol;
  52. real_ip_recursive on;
  53. set_real_ip_from xxx.xxx.xxx.xxx;
  54.  
  55. # enabled sites
  56. include /etc/nginx/sites-enabled/*;
  57. }
  58.  
  59.  
  60.  
  61. **************** sites-enabled.conf *************
  62.  
  63.  
  64. server {
  65. listen 80;
  66. server_name localhost;
  67. access_log logs/access.log combined;
  68.  
  69.  
  70. root /server/webdev/www/xxx;
  71. index index.html index.htm index.php;
  72. ### root directory ###
  73.  
  74. set $skip_cache 1;
  75.  
  76. include /etc/nginx/rewrite.conf.d/xxx.conf;
  77.  
  78. ### security ###
  79. #error_page 403 = 404;
  80. ### php block ###
  81. location /home/giftcode {
  82. try_files $uri $uri/ /home/index.php$is_args$args;
  83.  
  84. }
  85.  
  86. location ~ \.php?$ {
  87.  
  88. try_files $uri =404;
  89. include fastcgi_params;
  90. fastcgi_pass unix:/var/run/php-fpm.sock;
  91. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  92. fastcgi_intercept_errors on;
  93. fastcgi_split_path_info ^(.+\.php)(.*)$;
  94. #Prevent version info leakage
  95. fastcgi_hide_header X-Powered-By;
  96.  
  97. fastcgi_buffer_size 128k;
  98. fastcgi_buffers 256 16k;
  99. fastcgi_busy_buffers_size 256k;
  100. fastcgi_temp_file_write_size 256k;
  101. }
  102.  
  103. location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
  104. access_log off;
  105. log_not_found off;
  106. expires max;
  107. }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement