Guest User

Untitled

a guest
Dec 11th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.76 KB | None | 0 0
  1. * << BeReq >> 294951
  2. - Begin bereq 294950 pass
  3. - Timestamp Start: 1513009334.530160 0.000000 0.000000
  4. - BereqMethod GET
  5. - BereqURL /checkout/
  6. - BereqProtocol HTTP/1.0
  7. - BereqHeader Host: www.mymagento.com
  8. - BereqHeader X-Forwarded-Host: www.mymagento.com
  9. - BereqHeader X-Real-IP: 37.6.210.242
  10. - BereqHeader X-Forwarded-Proto: https
  11. - BereqHeader X-Forwarded-Port: 443
  12. - BereqHeader X-Forwarded-Proto: https
  13. - BereqHeader Content-Length: 0
  14. - BereqHeader user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
  15. - BereqHeader accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  16. - BereqHeader accept-language: en-US,en;q=0.5
  17. - BereqHeader accept-encoding: gzip, deflate, br
  18. - BereqHeader referer: https://www.mymagento.com/catalog/product/view/id/3350/s/1510911799-kalson-elafaki-mayro/category/41/
  19. - BereqHeader upgrade-insecure-requests: 1
  20. - BereqHeader cookie: _ga=GA1.2.2063407653.1510934108; __zlcmid=jpgwnJ1tBFQDKV; intercom-session-xmx5ec9n=dWh5bmg4Y29Sb2FZUW9ybEN6YzJSVGpycE1CZkQvK0hhZnFJYmhNOTJmems0d3p3NkgvSWNORmVVcFRneTVFMy0tOG5JTXJ3aHFYRFlnaTUvbmM4Z1BQZz09--5a2e1ecdcaf4577b3b82a02ad1271c00b50931b1
  21. - BereqHeader X-Forwarded-For: 37.6.210.242, 127.0.0.1
  22. - BereqHeader X-Varnish: 294951
  23. - VCL_call BACKEND_FETCH
  24. - VCL_return fetch
  25. - Backend 14 default default(127.0.0.1,,8080)
  26. - Timestamp Bereq: 1513009334.530267 0.000107 0.000107
  27. - Timestamp Beresp: 1513009334.720461 0.190301 0.190194
  28. - BerespProtocol HTTP/1.1
  29. - BerespStatus 200
  30. - BerespReason OK
  31. - BerespHeader Server: nginx
  32. - BerespHeader Date: Mon, 11 Dec 2017 16:22:14 GMT
  33. - BerespHeader Content-Type: text/html; charset=UTF-8
  34. - BerespHeader Connection: close
  35. - BerespHeader Vary: Accept-Encoding
  36. - BerespHeader X-Powered-By: PHP/7.1
  37. - BerespHeader Set-Cookie: form_key=HitLxJK4OFvkFpFq; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=mage2secure.magedeploy.com
  38. - BerespHeader Set-Cookie: form_key=HitLxJK4OFvkFpFq; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=mage2secure.magedeploy.com
  39. - BerespHeader Set-Cookie: PHPSESSID=suasda12321sgrb840ebodav186; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=www.mymagento.com; secure; HttpOnly
  40. - BerespHeader Set-Cookie: X-Magento-Vary=7f0ec19209469e9c448407b53fa5e756e55a0200; path=/; secure; HttpOnly
  41. - BerespHeader Pragma: no-cache
  42. - BerespHeader Cache-Control: max-age=0, must-revalidate, no-cache, no-store
  43. - BerespHeader Expires: Sun, 11 Dec 2016 16:22:14 GMT
  44. - BerespHeader X-Content-Type-Options: nosniff
  45. - BerespHeader X-XSS-Protection: 1; mode=block
  46. - BerespHeader X-Frame-Options: SAMEORIGIN
  47. - TTL RFC 0 -1 -1 1513009335 1513009335 1513009334 1481473334 0
  48. - VCL_call BACKEND_RESPONSE
  49. - TTL VCL -1 259200 0 1513009335
  50. - TTL VCL 120 259200 0 1513009335
  51. - VCL_return deliver
  52. - BerespHeader Content-Encoding: gzip
  53. - Storage malloc Transient
  54. - ObjProtocol HTTP/1.1
  55. - ObjStatus 200
  56. - ObjReason OK
  57. - ObjHeader Server: nginx
  58. - ObjHeader Date: Mon, 11 Dec 2017 16:22:14 GMT
  59. - ObjHeader Content-Type: text/html; charset=UTF-8
  60. - ObjHeader Vary: Accept-Encoding
  61. - ObjHeader X-Powered-By: PHP/7.0.26
  62. - ObjHeader Set-Cookie: form_key=HitLxJK4OFvkFpFq; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=mage2secure.magedeploy.com
  63. - ObjHeader Set-Cookie: form_key=HitLxJK4OFvkFpFq; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=mage2secure.magedeploy.com
  64. - ObjHeader Set-Cookie: PHPSESSID=su53asdad223sgrb83dav186; expires=Mon, 11-Dec-2017 17:22:14 GMT; Max-Age=3600; path=/; domain=mage2secure.magedeploy.com; secure; HttpOnly
  65. - ObjHeader Set-Cookie: X-Magento-Vary=7f0ec19209469e9c448407b53fa5e756e55a0200; path=/; secure; HttpOnly
  66. - ObjHeader Pragma: no-cache
  67. - ObjHeader Cache-Control: max-age=0, must-revalidate, no-cache, no-store
  68. - ObjHeader Expires: Sun, 11 Dec 2016 16:22:14 GMT
  69. - ObjHeader X-Content-Type-Options: nosniff
  70. - ObjHeader X-XSS-Protection: 1; mode=block
  71. - ObjHeader X-Frame-Options: SAMEORIGIN
  72. - ObjHeader Content-Encoding: gzip
  73. - Fetch_Body 4 eof -
  74. - VSL flush
  75. - End synth
  76.  
  77. vcl 4.0; import std;
  78. # The minimal Varnish version is 4.0 For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto:
  79. # https'
  80. backend default {
  81. .host = "localhost";
  82. .port = "8080";
  83. .first_byte_timeout = 900s;
  84. .probe = {
  85. .url = "/health_check.php";
  86. .timeout = 2s;
  87. .interval = 5s;
  88. .window = 10;
  89. .threshold = 5;
  90. }
  91. }
  92. acl purge {
  93. "localhost";
  94. }
  95. sub vcl_recv {
  96. if (req.method == "PURGE") {
  97. if (client.ip !~ purge) {
  98. return (synth(405, "Method not allowed"));
  99. }
  100. # To use the X-Pool header for purging varnish during automated deployments, make sure the X-Pool header has been added to the response in
  101. # your backend server config. This is used, for example, by the capistrano-magento2 gem for purging old content from varnish during it's
  102. # deploy routine.
  103. if (!req.http.X-Magento-Tags-Pattern && !req.http.X-Pool) {
  104. return (synth(400, "X-Magento-Tags-Pattern or X-Pool header required"));
  105. }
  106. if (req.http.X-Magento-Tags-Pattern) {
  107. ban("obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern);
  108. }
  109. if (req.http.X-Pool) {
  110. ban("obj.http.X-Pool ~ " + req.http.X-Pool);
  111. }
  112.  
  113. return (synth(200, "Purged"));
  114. }
  115. if (req.method != "GET" &&
  116. req.method != "HEAD" &&
  117. req.method != "PUT" &&
  118. req.method != "POST" &&
  119. req.method != "TRACE" &&
  120. req.method != "OPTIONS" &&
  121. req.method != "DELETE") {
  122. /* Non-RFC2616 or CONNECT which is weird. */
  123. #was pi pe
  124. return (pass);
  125. }
  126. # We only deal with GET and HEAD by default
  127. if (req.method != "GET" && req.method != "HEAD") {
  128. return (pass);
  129. }
  130. # Bypass shopping cart, checkout and search requests
  131. if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") {
  132. return (pass);
  133. }
  134.  
  135. # Bypass health check requests
  136. if (req.url ~ "/health_check.php") {
  137. return (pass);
  138. }
  139. # Set initial grace period usage status
  140. set req.http.grace = "none";
  141. # normalize url in case of leading HTTP scheme and domain
  142. set req.url = regsub(req.url, "^http[s]?://", "");
  143. # collect all cookies
  144. std.collect(req.http.Cookie);
  145. # Compression filter. See https://www.varnish-cache.org/trac/wiki/FAQ/Compression
  146. if (req.http.Accept-Encoding) {
  147. if (req.url ~ ".(jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf|flv)$") {
  148. # No point in compressing these
  149. unset req.http.Accept-Encoding;
  150. } elsif (req.http.Accept-Encoding ~ "gzip") {
  151. set req.http.Accept-Encoding = "gzip";
  152. } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") {
  153. set req.http.Accept-Encoding = "deflate";
  154. } else {
  155. # unkown algorithm
  156. unset req.http.Accept-Encoding;
  157. }
  158. }
  159. # Remove Google gclid parameters to minimize the cache objects
  160. set req.url = regsuball(req.url,"?gclid=[^&]+$",""); # strips when QS = "?gclid=AAA"
  161. set req.url = regsuball(req.url,"?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar"
  162. set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz"
  163. # Static files caching
  164. if (req.url ~ "^/(pub/)?(media|static)/") {
  165. # Static files should not be cached by default
  166. # return (hash);
  167. # But if you use a few locales and don't use CDN you can enable caching static files by commenting previous line (#return (pass);) and
  168. #uncommenting next 3 lines
  169. unset req.http.Https;
  170. unset req.http.X-Forwarded-Proto;
  171. unset req.http.Cookie;
  172. }
  173. return (hash);
  174. }
  175.  
  176. sub vcl_hash {
  177. if (req.http.cookie ~ "X-Magento-Vary=") {
  178. hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "1"));
  179. }
  180. # For multi site configurations to not cache each other's content
  181. if (req.http.host) {
  182. hash_data(req.http.host);
  183. } else {
  184. hash_data(server.ip);
  185. }
  186. # To make sure http users don't see ssl warning
  187. if (req.http.X-Forwarded-Proto) {
  188. hash_data(req.http.X-Forwarded-Proto);
  189. }
  190. if (req.http.user-agent ~ "(?i)iPhone") {
  191. hash_data("8");
  192. } elsif (req.http.user-agent ~ "(?i)iPod") {
  193. hash_data("8");
  194. } elsif (req.http.user-agent ~ "(?i)BlackBerry") {
  195. hash_data("8");
  196. } elsif (req.http.user-agent ~ "(?i)Palm") {
  197. hash_data("8");
  198. } elsif (req.http.user-agent ~ "(?i)Googlebot-Mobile") {
  199. hash_data("8");
  200. } elsif (req.http.user-agent ~ "(?i)Windows Mobile") {
  201. hash_data("8");
  202. } elsif (req.http.user-agent ~ "(?i)Android") {
  203. hash_data("8");
  204. } elsif (req.http.user-agent ~ "(?i)Opera") {
  205. hash_data("8");
  206. }
  207. }
  208. sub vcl_backend_response {
  209. set beresp.grace = 3d;
  210. if (beresp.http.content-type ~ "text") {
  211. set beresp.do_esi = true;
  212. }
  213. if (bereq.url ~ ".js$" || beresp.http.content-type ~ "text") {
  214. set beresp.do_gzip = true;
  215. }
  216. # cache only successfully responses and 404s
  217. if (beresp.status != 200 && beresp.status != 404) {
  218. set beresp.ttl = 0s;
  219. set beresp.uncacheable = true;
  220. return (deliver);
  221. } elsif (beresp.http.Cache-Control ~ "private") {
  222. set beresp.uncacheable = true;
  223. set beresp.ttl = 86400s;
  224. return (deliver);
  225. }
  226. if (beresp.http.X-Magento-Debug) {
  227. set beresp.http.X-Magento-Cache-Control = beresp.http.Cache-Control;
  228. }
  229. # validate if we need to cache it and prevent from setting cookie
  230. if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
  231. unset beresp.http.set-cookie;
  232. }
  233. # If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass
  234. if (beresp.ttl <= 0s ||
  235. beresp.http.Surrogate-control ~ "no-store" ||
  236. (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) {
  237. # Mark as Hit-For-Pass for the next 2 minutes
  238. set beresp.ttl = 120s;
  239. set beresp.uncacheable = true;
  240. }
  241. return (deliver);
  242. }
  243.  
  244. sub vcl_deliver {
  245. if (resp.http.X-Magento-Debug) {
  246. if (resp.http.x-varnish ~ " ") {
  247. set resp.http.X-Magento-Cache-Debug = "HIT";
  248. set resp.http.Grace = req.http.grace;
  249. } else {
  250. set resp.http.X-Magento-Cache-Debug = "MISS";
  251. }
  252. } else {
  253. unset resp.http.Age;
  254. }
  255. unset resp.http.X-Magento-Debug;
  256. unset resp.http.X-Magento-Tags;
  257. unset resp.http.X-Powered-By;
  258. unset resp.http.Server;
  259. unset resp.http.X-Varnish;
  260. unset resp.http.Via;
  261. unset resp.http.Link;
  262. }
  263. sub vcl_hit {
  264. if (obj.ttl >= 0s) {
  265. # Hit within TTL period
  266. return (deliver);
  267. }
  268. if (std.healthy(req.backend_hint)) {
  269. if (obj.ttl + 300s > 0s) {
  270. # Hit after TTL expiration, but within grace period
  271. set req.http.grace = "normal (healthy server)";
  272. return (deliver);
  273. } else {
  274. # Hit after TTL and grace expiration
  275. return (fetch);
  276. }
  277. } else {
  278. # server is not healthy, retrieve from cache
  279. set req.http.grace = "unlimited (unhealthy server)";
  280. return (deliver);
  281. }
  282. }
  283.  
  284. server {
  285. listen 80;
  286. server_name www.mymagento.com;
  287. location /.well-known/ {
  288. default_type "text/plain";
  289. try_files $uri =404;
  290. }
  291. return 301 https://$host$request_uri;
  292. }
  293.  
  294. server {
  295. server_name www.mymagento.com;
  296.  
  297. listen 443 ssl http2;
  298. ssl_certificate /etc/letsencrypt/live/magento/fullchain.pem;
  299. ssl_certificate_key /etc/letsencrypt/live/magento/privkey.pem;
  300.  
  301. # port_in_redirect off;
  302.  
  303. include https_basic.conf;
  304.  
  305. keepalive_timeout 0s;
  306.  
  307. location / {
  308. proxy_pass http://127.0.0.1:6081;
  309. proxy_set_header Host $http_host;
  310. proxy_set_header X-Forwarded-Host $http_host;
  311. proxy_set_header X-Real-IP $remote_addr;
  312. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  313. # proxy_set_header Ssl-Offloaded "1";
  314. proxy_set_header X-Forwarded-Proto https;
  315. proxy_set_header X-Forwarded-Port 443;
  316. proxy_set_header X-Forwarded-Proto $scheme;
  317.  
  318. }
  319. }
  320.  
  321.  
  322. server {
  323. server_name www.mymagento.com;
  324. listen 8080;
  325.  
  326. root /home/magento/public_html/pub/;
  327.  
  328. set $HTTPS_FORWARD on;
  329.  
  330. index index.php;
  331. charset UTF-8;
  332. error_page 404 403 = /errors/404.php;
  333. expires off;
  334.  
  335. # PHP entry point for setup application
  336. location ~* ^/setup($|/) {
  337. root /home/kirakalo/public_html/;
  338. location ~ ^/setup/index.php {
  339. # if (!-e $request_filename) { rewrite / /index.php last; }
  340. fastcgi_pass 127.0.0.1:9007;
  341. fastcgi_index index.php;
  342. fastcgi_read_timeout 600s;
  343.  
  344. fastcgi_connect_timeout 600s;
  345. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  346. # fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
  347. include fastcgi_params;
  348. # access_log /var/log/nginx/phpfpmonly-access.log;
  349. }
  350.  
  351. location ~ ^/setup/(?!pub/). {
  352. deny all;
  353. }
  354.  
  355. location ~ ^/setup/pub/ {
  356. add_header X-Frame-Options "SAMEORIGIN";
  357. }
  358. }
  359.  
  360. # PHP entry point for update application
  361. location ~* ^/update($|/) {
  362. root /home/kirakalo/public_html/;
  363.  
  364. location ~ ^/update/index.php {
  365. fastcgi_split_path_info ^(/update/index.php)(/.+)$;
  366. fastcgi_pass 127.0.0.1:9007;
  367. fastcgi_index index.php;
  368.  
  369. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  370. fastcgi_param PATH_INFO $fastcgi_path_info;
  371. # fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
  372. include fastcgi_params;
  373. # access_log /var/log/nginx/phpfpmonly-access.log;
  374. }
  375.  
  376. # Deny everything but index.php
  377. location ~ ^/update/(?!pub/). {
  378. deny all;
  379. }
  380.  
  381. location ~ ^/update/pub/ {
  382. add_header X-Frame-Options "SAMEORIGIN";
  383. }
  384. }
  385.  
  386. location / {
  387. try_files $uri $uri/ /index.php$is_args$args;
  388. }
  389.  
  390. location /pub/ {
  391. location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*.xml) {
  392. deny all;
  393. }
  394. alias /home/kirakalo/public_html/pub/;
  395. add_header X-Frame-Options "SAMEORIGIN";
  396.  
  397. location ~ ^/pub/static/version {
  398. rewrite ^/pub/static/(versiond*/)?(.*)$ /pub/static/$2 last;
  399. }
  400.  
  401. }
  402.  
  403.  
  404. location /static/ {
  405. # Uncomment the following line in production mode
  406. # expires max;
  407.  
  408. # Remove signature of the static files that is used to overcome the browser cache
  409. location ~ ^/static/version {
  410. rewrite ^/static/(versiond*/)?(.*)$ /static/$2 last;
  411. }
  412.  
  413. location ~* .(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
  414. add_header Cache-Control "public";
  415. add_header X-Frame-Options "SAMEORIGIN";
  416. expires +1y;
  417.  
  418. if (!-f $request_filename) {
  419. rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  420. }
  421. }
  422. location ~* .(zip|gz|gzip|bz2|csv|xml)$ {
  423. add_header Cache-Control "no-store";
  424. add_header X-Frame-Options "SAMEORIGIN";
  425. expires off;
  426.  
  427. if (!-f $request_filename) {
  428. rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  429. }
  430. }
  431. if (!-f $request_filename) {
  432. rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
  433. }
  434. add_header X-Frame-Options "SAMEORIGIN";
  435. }
  436.  
  437.  
  438. location /media/ {
  439. try_files $uri $uri/ /get.php$is_args$args;
  440.  
  441. location ~ ^/media/theme_customization/.*.xml {
  442. deny all;
  443. }
  444.  
  445. location ~* .(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
  446. add_header Cache-Control "public";
  447. add_header X-Frame-Options "SAMEORIGIN";
  448. # expires +1y;
  449. try_files $uri $uri/ /get.php$is_args$args;
  450. }
  451. location ~* .(zip|gz|gzip|bz2|csv|xml)$ {
  452. add_header Cache-Control "no-store";
  453. add_header X-Frame-Options "SAMEORIGIN";
  454. expires off;
  455. try_files $uri $uri/ /get.php$is_args$args;
  456. }
  457. add_header X-Frame-Options "SAMEORIGIN";
  458. }
  459.  
  460. location /media/customer/ {
  461. deny all;
  462. }
  463.  
  464. location /media/downloadable/ {
  465. deny all;
  466. }
  467.  
  468. location /media/import/ {
  469. deny all;
  470. }
  471.  
  472.  
  473. location ~ (health_check|op1337|index|get|static|report|404|503).php$ {
  474. try_files $uri =404;
  475. fastcgi_pass 127.0.0.1:9007;
  476. fastcgi_param HTTPS $HTTPS_FORWARD;
  477.  
  478. # fastcgi_read_timeout 600s;
  479. # fastcgi_connect_timeout 600s;
  480.  
  481. fastcgi_index index.php;
  482. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  483. fastcgi_param PATH_INFO $fastcgi_path_info;
  484. include fastcgi_params;
  485. access_log /var/log/nginx/phpfpmonly-access.log;
  486. }
  487.  
  488. location ~* (.php$|.htaccess$|.git) {
  489. deny all;
  490. }
  491.  
  492. }
Add Comment
Please, Sign In to add comment