Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. user nginx;
  2. worker_processes 10;
  3. pid /var/run/nginx.pid;
  4.  
  5. events {
  6. worker_connections 1000;
  7. }
  8.  
  9. http {
  10.  
  11. sendfile on;
  12. tcp_nopush on;
  13. tcp_nodelay on;
  14. keepalive_timeout 65;
  15. types_hash_max_size 2048;
  16.  
  17. include /etc/nginx/mime.types;
  18. default_type application/octet-stream;
  19.  
  20. ##
  21. # Logging Settings
  22. ##
  23.  
  24. log_format log_cache [$time_local] $remote_addr " - " '"$request"' " - " $upstream_cache_status " " $request_time " - " $status " " $body_bytes_sent ' "$http_referer" "$http_user_agent"';
  25. access_log /var/log/nginx/access.log log_cache;
  26. error_log /var/log/nginx/error.log;
  27.  
  28. ##
  29. # Gzip Settings
  30. ##
  31.  
  32. gzip on;
  33. gzip_disable "msie6";
  34. gzip_static on;
  35. gzip_comp_level 4;
  36. gzip_proxied any;
  37. gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;
  38.  
  39.  
  40. proxy_cache_path /var/nginx/cache levels=1 keys_zone=mycache:50m inactive=7d;
  41. proxy_cache_key $request_uri;
  42. proxy_store on;
  43. proxy_temp_path /var/nginx/tmp;
  44. proxy_buffering on;
  45. fastcgi_buffers 8 16k;
  46. fastcgi_buffer_size 32k;
  47.  
  48.  
  49. #include /etc/nginx/conf.d/*.conf;
  50. #include /etc/nginx/sites-enabled/*;
  51.  
  52.  
  53. server {
  54. listen 80 default_server;
  55. listen [::]:80 default_server ipv6only=on;
  56.  
  57. # Make site accessible from http://localhost/
  58. server_name localhost;
  59.  
  60. root /var/nginx/www;
  61.  
  62. proxy_cache mycache;
  63. proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504 http_404;
  64. #proxy_cache_valid any 5m;
  65. #proxy_cache_valid 404 1d;
  66.  
  67. location / {
  68. proxy_pass http://other:8080;
  69. proxy_set_header X-Real-IP $remote_addr;
  70. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  71. proxy_set_header Host $http_host;
  72. #proxy_hide_header Cache-Control;
  73. #Proxy_ignore_headers Cache-Control Expires Set-Cookie;
  74.  
  75. error_page 404 /error.html;
  76. error_page 500 /error.html;
  77. error_page 502 /error.html;
  78. error_page 503 /error.html;
  79. error_page 504 /error.html;
  80. }
  81. }
  82.  
  83. }
  84.  
  85. GET / HTTP/1.1
  86.  
  87. HTTP/1.1 200 OK
  88. Server: nginx/1.0.15
  89. Date: Tue, 07 Jan 2014 14:16:34 GMT
  90. Content-Type: text/html;charset=UTF-8
  91. Transfer-Encoding: chunked
  92. Connection: keep-alive
  93. Pragma: no-cache
  94. Expires: Tue, 07 Jan 2014 14:21:34 GMT
  95. Cache-Control: max-age=300, must-revalidate
  96. Last-Modified: Fri, 03 Jan 2014 18:15:48 GMT
  97. Content-Language: en-US
  98. Content-Encoding: gzip
  99.  
  100. GET /x.json HTTP/1.1
  101.  
  102. HTTP/1.1 200 OK
  103. Server: nginx/1.0.15
  104. Date: Tue, 07 Jan 2014 14:16:53 GMT
  105. Content-Type: application/json;charset=UTF-8
  106. Transfer-Encoding: chunked
  107. Connection: keep-alive
  108. Expires: Tue, 07 Jan 2014 14:21:53 GMT
  109. Cache-Control: max-age=300, must-revalidate
  110. Content-Encoding: gzip
  111.  
  112. HTTP/1.1 200 OK
  113. Server: Apache-Coyote/1.1
  114. Expires: Thu, 09 Jan 2014 16:46:54 GMT
  115. Cache-Control: max-age=300, must-revalidate
  116. Set-Cookie: JSESSIONID=8A30B35F5BA063A2A5483189C95BFF54; Path=/; HttpOnly
  117. Content-Type: text/html;charset=UTF-8
  118. Content-Language: en-US
  119. Transfer-Encoding: chunked
  120. Date: Thu, 09 Jan 2014 16:41:54 GMT
  121.  
  122. [07/Jan/2014:14:16:53 +0000]1.1.1.2 - "GET /x.json HTTP/1.1" - MISS 0.070 - 200 13850 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
  123. [07/Jan/2014:14:31:32 +0000]1.1.1.2 - "GET / HTTP/1.1" - HIT 0.000 - 200 1902 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
  124.  
  125. 2014/01/07 14:16:53 [crit] 24811#0: *18497 mkdir() "/var/nginx/www/x" failed (2: No such file or directory) while reading upstream, client: 1.1.1.100, server: localhost, request: "GET /x.json HTTP/1.1", upstream: "http://other.server/x.json", host: "1.1.1.3"
  126. 2014/01/07 14:16:53 [crit] 24811#0: *18497 chmod() "/var/nginx/tmp/0000008596" failed (2: No such file or directory) while reading upstream, client: 1.1.1.100, server: localhost, request: "GET /x.json HTTP/1.1", upstream: "http://other.server/x.json", host: "1.1.1.3"
  127. 2014/01/07 14:16:53 [crit] 24811#0: *18497 unlink() "/var/nginx/tmp/0000008596" failed (2: No such file or directory) while reading upstream, client: 1.1.1.100, server: localhost, request: "GET /x.json HTTP/1.1", upstream: "http://other.server/x.json", host: "1.1.1.3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement