|
@ -31,8 +31,9 @@ server { |
|
|
real_ip_header X-Real-IP; |
|
|
real_ip_header X-Real-IP; |
|
|
|
|
|
|
|
|
location = / { |
|
|
location = / { |
|
|
|
|
|
set $empty ""; |
|
|
if ($http_user_agent ~* (curl|wget)) { |
|
|
if ($http_user_agent ~* (curl|wget)) { |
|
|
return 200 $remote_addr\n; |
|
|
proxy_pass http://127.0.0.1:1601/ip$empty; |
|
|
} |
|
|
} |
|
|
index index.html; |
|
|
index index.html; |
|
|
} |
|
|
} |
|
@ -46,10 +47,14 @@ server { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
location = /ip { |
|
|
location = /ip { |
|
|
|
|
|
set $query justip=true; |
|
|
if ($http_user_agent ~* (curl|wget)) { |
|
|
if ($http_user_agent ~* (curl|wget)) { |
|
|
return 200 $remote_addr\n; |
|
|
set $query $query&cli=true; |
|
|
} |
|
|
} |
|
|
return 200 $remote_addr; |
|
|
include fastcgi_params; |
|
|
|
|
|
fastcgi_pass 127.0.0.1:9000; # php-fpm接口 |
|
|
|
|
|
fastcgi_param QUERY_STRING $query; |
|
|
|
|
|
fastcgi_param SCRIPT_FILENAME /var/www/echoIP/backend/queryInfo.php; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
location ~* ^/([^/]+?)$ { |
|
|
location ~* ^/([^/]+?)$ { |
|
@ -61,11 +66,9 @@ server { |
|
|
|
|
|
|
|
|
location ^~ /info { |
|
|
location ^~ /info { |
|
|
set $is_cli 0; |
|
|
set $is_cli 0; |
|
|
set $is_https 0; |
|
|
|
|
|
set $is_legal 0; |
|
|
set $is_legal 0; |
|
|
if ($uri ~* ^/info/?$) { |
|
|
if ($uri ~* ^/info/?$) { |
|
|
set $is_legal 1; |
|
|
set $is_legal 1; |
|
|
set $query ip=$remote_addr; |
|
|
|
|
|
} |
|
|
} |
|
|
if ($uri ~* ^/info/([^/]+?)$) { |
|
|
if ($uri ~* ^/info/([^/]+?)$) { |
|
|
set $is_legal 1; |
|
|
set $is_legal 1; |
|
|