Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/adblockplusorg/files/adblockplus.org

Issue 9160083: Put both requested and actual browser page in the HTML (Closed)
Left Patch Set: Created Jan. 9, 2013, 12:52 p.m.
Right Patch Set: Created Jan. 9, 2013, 12:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 server { 1 server {
2 root /var/www/adblockplus.org/httpdocs; 2 root /var/www/adblockplus.org/httpdocs;
3 3
4 location / { 4 location / {
5 index index.php index index.html; 5 index index.php index index.html;
6 6
7 if ($arg_a = "view") { 7 if ($arg_a = "view") {
8 rewrite ^(.*) $1? permanent; 8 rewrite ^(.*) $1? permanent;
9 } 9 }
10 10
(...skipping 25 matching lines...) Expand all
36 rewrite ^/anwiki/(.*) /$1 permanent; 36 rewrite ^/anwiki/(.*) /$1 permanent;
37 37
38 if (-f $request_filename) { 38 if (-f $request_filename) {
39 break; 39 break;
40 } 40 }
41 if (-d $request_filename) { 41 if (-d $request_filename) {
42 break; 42 break;
43 } 43 }
44 44
45 set $static_uri $uri; 45 set $static_uri $uri;
46 set $browser $user_agent; 46 set $platform $user_agent;
47 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$) { 47 if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$) {
48 set $static_uri "/$1/"; 48 set $static_uri "/$1/";
49 set $browser $3; 49 set $platform $3;
50 } 50 }
51 set $static ""; 51 set $static "";
52 if (-f "$document_root/static$static_uri") { 52 if (-f "$document_root/static$static_uri") {
53 set $static "ok"; 53 set $static "ok";
54 } 54 }
55 if (-d "$document_root/static$static_uri") { 55 if (-d "$document_root/static$static_uri") {
56 set $static "ok"; 56 set $static "ok";
57 } 57 }
58 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; 58 set $static "$static!$arg_a!$cookie_anwiki_anwsesscode";
59 if ($static ~ ^ok!(view|show)?!$) { 59 if ($static ~ ^ok!(view|show)?!$) {
60 rewrite ^ /static$static_uri?browser=$browser&user_agent=$user_agent last; 60 rewrite ^ /static$static_uri?platform=$platform&user_agent=$user_agent las t;
61 } 61 }
62 62
63 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$ /index.php?p=$1&b rowser=$3&user_agent=$user_agent last; 63 rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$ /index.php?p=$1&p latform=$3&user_agent=$user_agent last;
64 rewrite ^/(.*) /index.php?p=$1 last; 64 rewrite ^/(.*) /index.php?p=$1 last;
65 } 65 }
66 66
67 location /static/ { 67 location /static/ {
68 index index; 68 index index;
69 internal; 69 internal;
70 types { 70 types {
71 image/png png; 71 image/png png;
72 text/xml xml; 72 text/xml xml;
73 text/css css; 73 text/css css;
74 } 74 }
75 default_type text/html; 75 default_type text/html;
76 charset utf-8; 76 charset utf-8;
77 77
78 if ($arg_browser) { 78 if ($arg_platform) {
79 set $browser_class ' class="$arg_browser ua-$arg_user_agent"'; 79 set $platform_class ' class="$arg_platform ua-$arg_user_agent"';
80 } 80 }
81 sub_filter ' id="content"' ' id="content"$browser_class'; 81 sub_filter ' id="content"' ' id="content"$platform_class';
82 } 82 }
83 83
84 84
85 location ~ \.php$ { 85 location ~ \.php$ {
86 client_max_body_size 8m; 86 client_max_body_size 8m;
87 87
88 if ($arg_browser) { 88 if ($arg_platform) {
89 set $browser_class ' class="$arg_browser ua-$arg_user_agent"'; 89 set $platform_class ' class="$arg_platform ua-$arg_user_agent"';
90 } 90 }
91 sub_filter ' id="content"' ' id="content"$browser_class'; 91 sub_filter ' id="content"' ' id="content"$platform_class';
92 92
93 fastcgi_pass unix:/tmp/php-fastcgi.sock; 93 fastcgi_pass unix:/tmp/php-fastcgi.sock;
94 fastcgi_index index.php; 94 fastcgi_index index.php;
95 95
96 fastcgi_param SCRIPT_FILENAME /var/www/adblockplus.org/phproot$fastcgi_scrip t_name; 96 fastcgi_param SCRIPT_FILENAME /var/www/adblockplus.org/phproot$fastcgi_scrip t_name;
97 97
98 fastcgi_param QUERY_STRING $query_string; 98 fastcgi_param QUERY_STRING $query_string;
99 fastcgi_param REQUEST_METHOD $request_method; 99 fastcgi_param REQUEST_METHOD $request_method;
100 fastcgi_param CONTENT_TYPE $content_type; 100 fastcgi_param CONTENT_TYPE $content_type;
101 fastcgi_param CONTENT_LENGTH $content_length; 101 fastcgi_param CONTENT_LENGTH $content_length;
102 102
103 fastcgi_param SCRIPT_NAME $fastcgi_script_name; 103 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
104 fastcgi_param REQUEST_URI $request_uri; 104 fastcgi_param REQUEST_URI $request_uri;
105 fastcgi_param DOCUMENT_URI $document_uri; 105 fastcgi_param DOCUMENT_URI $document_uri;
106 fastcgi_param DOCUMENT_ROOT $document_root; 106 fastcgi_param DOCUMENT_ROOT $document_root;
107 fastcgi_param SERVER_PROTOCOL $server_protocol; 107 fastcgi_param SERVER_PROTOCOL $server_protocol;
108 108
109 fastcgi_param GATEWAY_INTERFACE CGI/1.1; 109 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
110 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 110 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
111 111
112 fastcgi_param REMOTE_ADDR $remote_addr; 112 fastcgi_param REMOTE_ADDR $remote_addr;
113 fastcgi_param REMOTE_PORT $remote_port; 113 fastcgi_param REMOTE_PORT $remote_port;
114 fastcgi_param SERVER_ADDR $server_addr; 114 fastcgi_param SERVER_ADDR $server_addr;
115 fastcgi_param SERVER_PORT $server_port; 115 fastcgi_param SERVER_PORT $server_port;
116 fastcgi_param SERVER_NAME $server_name; 116 fastcgi_param SERVER_NAME $server_name;
117 } 117 }
118 } 118 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld