ruby - How to intercept sinatra http traffic? -


I was trying to understand why I was getting the wrong code host . The nginx setup was as follows:

  server {server_name ws1; Root / Home / Yuri / WS1 / Public; Access_log /var/log/nginx/ws1-access.log; Error_log /var/log/nginx/ws1-error.log; Location / {try_files $ url_ruby; } Location @ ruby ​​{proxy_pass http: // localhost: 4567; Host $ proxy_set_header host; }}  

This is the output of my application:

  $ ruby ​​app.rb [2014-02-18 11:30:01] Information WEBrick 1.3.1 [2014-02-18 11:30:01] INFO Ruby 2.0.0 (2013-06-27) [x86_64-linux] == Sinatra / 1.4.4 up to 4567 level for development with back up WEBrick [2014-02-18 11:30:01] WEBrick :: HTTPServer # start: pid = 2486 ports = 4567 127.0.0.1 - - [18 February / 2014 11:30:42] "GET / HTTP / 1.1 "200 8 0.1158 localhost - - [18 / f / 2014: 11: 30: 42EET]" Received / HTTP / 1.0 "200 8 - - & gt;  

Before making a request I started the root account under tcpdump : tcpdump -w 1.pcap port 4567 . best captured this 2 packets (sometimes not) It is believed that any packet is captured without a blank file:

  00000000 D4C3B2A1 │ 02 00 04 00 │ 00 00 00 │ 00 00 00 │ FF FF 00 00 ยบ ^^^^^^^^^^^^^^ @ 00000014 01 00 00 00 │ ^^^^ @  

I was able to capture the nginx traffic like this, am I doing it wrong?

P.S. I'm running debian 6 .


Comments