Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- #httpd for system web api
- #
- user root root;
- worker_processes 2;
- worker_rlimit_nofile 1024;
- #
- #/etc/init.d/sysapihttpd
- #
- #error log will send to stdout and save by syslog
- #
- daemon off;
- #master_process off;
- #nginx connect() failed (128: Unknown error) is Destination Net Unreachable
- #debug | info | notice | warn | error | crit
- error_log stderr warn;
- #pid logs/nginx.pid;
- events {
- use epoll;
- worker_connections 512;
- }
- http {
- #
- include mime.types;
- default_type application/octet-stream;
- #\t"$upstream_cache_status" replaced by \t"$sent_http_ MiCGI_Cache_Status"
- log_format main '"$server_addr"\t"$host"\t"$remote_addr"\t"$time_local"\t"$request_method $request_uri"\t"$status"\t"$request_length"\t"$bytes_sent"\t"$request_time"\t"$sent_http_ MiCGI_Cache_Status"\t"$upstream_addr"\t"$upstream_response_time"\t"$http_referer"\t"$http_user_agent"';
- #access_log /userdisk/sysapihttpd/log/access.log main;
- access_log off;
- sendfile on;
- #tcp_nopush on;
- #http://wiki.nginx.org/HttpCoreModule#server_tokens
- server_tokens off;
- #disable keepalive for webinitrdr
- keepalive_timeout 0;
- # zeor for no max limit
- client_max_body_size 0;
- #
- proxy_buffering on;
- proxy_max_temp_file_size 2m;
- proxy_buffer_size 256k;
- proxy_buffers 32 32k;
- proxy_busy_buffers_size 256k;
- server_names_hash_bucket_size 64;
- proxy_headers_hash_bucket_size 128;
- proxy_headers_hash_max_size 8192;
- #https://groups.google.com/forum/#!msg/openresty/sgNvuGk0tlQ/lFxfl-mg9HMJ
- #2013/08/08 11:50:03 [error] 3971#0: wrong ident 16756 response for www.youtube.com, expect 35660
- proxy_connect_timeout 186;
- proxy_read_timeout 1200;
- proxy_send_timeout 1200;
- #gzip on;
- #gzip_min_length 1024;
- #gzip_proxied expired no-cache no-store private auth no_last_modified no_etag;
- #gzip_types application/json application/x-json text/css text/xml text/plain application/xml;
- #gzip_disable "MSIE [1-6]\.";
- fastcgi_connect_timeout 300;
- fastcgi_read_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_buffer_size 64k;
- fastcgi_buffers 4 32k;
- fastcgi_busy_buffers_size 64k;
- fastcgi_temp_file_write_size 64k;
- limit_conn_zone $binary_remote_addr zone=addr_zone:256k;
- server {
- #
- #server for sysapi
- #
- listen 0.0.0.0:80;
- listen 0.0.0.0:8098;
- server_name _;
- access_log off;
- #access_log /userdisk/sysapihttpd/log/luaroot.access.log main;
- log_not_found off;
- #
- keepalive_timeout 0;
- ##r1cm has disk space
- upload_reserve_free_memory 0;
- #
- root /www;
- index index.html index.htm;
- # 0.0.0.1:65535 no avaible
- #redirect 0.0.0.1:65535 127.0.0.1:5081;
- #disable proxy errors handle
- proxy_intercept_errors off;
- #http://wiki.nginx.org/HttpCoreModule#reset_timedout_connection
- reset_timedout_connection on;
- expires epoch;
- #
- include 'miwifi-webinitrd.conf';
- #
- location = /miwifi.html
- {
- root /etc/sysapihttpd/htdocs/;
- }
- location = /stat/proxy.shtml {
- #
- keepalive_timeout 0;
- access_log off;
- #
- add_header MiCGI-StatChain STAT;
- proxy_set_header Host miwifi.com;
- proxy_pass http://127.0.0.1:5081;
- #
- }
- location /backup/share {
- alias /userdisk/data/;
- }
- location /backup/privacy {
- alias /userdisk/privacyData/;
- }
- location /backup/thumbnail/share {
- alias /userdisk/.thumbnails/smallIcons/userdisk/data/;
- }
- location /backup/thumbnail/privacy {
- alias /userdisk/.thumbnails/smallIcons/userdisk/privacyData/;
- }
- location /api/service/plugin {
- rewrite ^/api/service/plugin/control /api-third-party/download/private/$arg_appid/control.html? permanent;
- }
- location /api-third-party/download/public {
- alias /userdisk/data/;
- }
- location /api-third-party/download/private {
- alias /userdisk/appdata/;
- }
- location /api-third-party/service {
- #
- add_header MiCGI-Switch "$finalvar";
- add_header MiCGI-Client-Ip $remote_addr;
- add_header MiCGI-Host $host;
- add_header MiCGI-Http-Host $http_host;
- add_header MiCGI-Server-Ip $server_addr;
- add_header MiCGI-Server-Port $server_port;
- add_header MiCGI-Status CGI;
- add_header MiCGI-Preload no;
- #
- if ($uri = "/api-third-party") {
- set $path_info $1;
- set $script_name '/cgi-bin/luci';
- set $luci_path '/www';
- }
- if ($uri ~ "^/api-third-party(/.+)") {
- set $path_info $1;
- set $script_name '/cgi-bin/luci';
- set $luci_path '/www';
- }
- #
- include 'fastcgi-proxy-pass.conf';
- #
- }
- location /uploadfile/cgi-bin {
- #
- #for POST /uploadfile/cgi-bin/luci/;stok=42822adbabf606fe7946cd2e9b98d9a5/api/xqsystem/upload_rom
- #
- add_header MiCGI-Switch "$finalvar";
- add_header MiCGI-Client-Ip $remote_addr;
- add_header MiCGI-Host $host;
- add_header MiCGI-Http-Host $http_host;
- add_header MiCGI-Server-Ip $server_addr;
- add_header MiCGI-Server-Port $server_port;
- add_header MiCGI-Status CGI;
- add_header MiCGI-Preload no;
- add_header MiCGI-Upload-File yes;
- # for upload roms only [start]
- client_body_temp_path /tmp/uploadfiles/;
- client_body_in_file_only on;
- client_body_buffer_size 16k;
- proxy_pass_request_headers on;
- proxy_set_body off;
- proxy_redirect off;
- fastcgi_param UPLOADFILE $request_body_file;
- upload_reserve_free_memory 1M;
- client_max_body_size 128M;
- #TODO: upload_multipart_cut
- #upload_multipart_cut on;
- fastcgi_max_temp_file_size 0;
- # for upload rom only [end]
- #
- include 'fastcgi-proxy-pass.conf';
- #
- }
- location /cgi-bin {
- #
- add_header MiCGI-Switch "$finalvar";
- add_header MiCGI-Client-Ip $remote_addr;
- add_header MiCGI-Host $host;
- add_header MiCGI-Http-Host $http_host;
- add_header MiCGI-Server-Ip $server_addr;
- add_header MiCGI-Server-Port $server_port;
- add_header MiCGI-Status CGI;
- add_header MiCGI-Preload no;
- #
- include 'fastcgi-proxy-pass.conf';
- #
- }
- location = /upload {
- #
- #TODO: fix r1cm memory usage
- #
- upload_pass /cgi-bin/upload;
- upload_cleanup 400 404 499 500-505;
- upload_store /userdisk/sysapihttpd/.upload_tmp;
- upload_store_access user:rw group:rw all:rw;
- upload_max_file_size 0;
- upload_limit_rate 0;
- upload_set_form_field "${upload_field_name}_name" $upload_file_name;
- upload_set_form_field "${upload_field_name}_content_type" $upload_content_type;
- upload_set_form_field "${upload_field_name}_path" $upload_tmp_path;
- upload_aggregate_form_field "${upload_field_name}_md5" $upload_file_md5;
- upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size;
- upload_pass_form_field "^.*$";
- upload_pass_args on;
- limit_conn addr_zone 10;
- }
- location ^~ /download-userdisk/ {
- internal;
- alias /userdisk/data/;
- }
- location ^~ /download-extdisks/ {
- internal;
- alias /extdisks/;
- }
- location ^~ /download-pridisk/ {
- internal;
- alias /userdisk/privacyData/;
- }
- #
- location / {
- #
- add_header MiCGI-Switch "$finalvar";
- add_header MiCGI-TproxyInfo "$dst_addr:$dst_port";
- add_header MiCGI-Upstream "$target_upstream";
- add_header MiCGI-Client-Ip $remote_addr;
- add_header MiCGI-Host $host;
- add_header MiCGI-Http-Host $http_host;
- add_header MiCGI-Server-Ip $server_addr;
- add_header MiCGI-Server-Port $server_port;
- add_header MiCGI-Status LUAROOT;
- add_header MiCGI-Preload no;
- #
- root /www;
- index index.html index.htm;
- #
- }
- #
- #**#error_page 404 /err/404.html;
- #**#error_page 500 /err/500.html;
- #**#error_page 501 /err/502.html;
- #**#error_page 502 /err/502.html;
- #**#error_page 503 /err/503.html;
- #**#error_page 504 /err/504.html;
- #
- location ~ /err/ {
- #
- internal;
- #
- access_log off;
- keepalive_timeout 0;
- #
- add_header MiCGI-Client-Ip $remote_addr;
- add_header MiCGI-Host $host;
- add_header MiCGI-Http-Host $http_host;
- add_header MiCGI-Server-Ip $server_addr;
- add_header MiCGI-Server-Port $server_port;
- add_header MiCGI-Preload no;
- #
- add_header MiCGI-Status ERR-HTML;
- add_header Cache-Control 'private,max-age=0';
- expires epoch;
- add_header Content-Type "text/html;charset=utf-8";
- #
- root /www/;
- }
- #
- location /sign_msg{
- sign_msg;
- sign_msg_config_file_path /userdisk/appdata/2882303761517185825/etc/plugin_config;
- client_body_in_file_only on;
- client_body_temp_path /tmp 1;
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- }
- location /welcome{
- welcome_command;
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- }
- location /mp4_movie_info {
- proxy_pass http://192.168.31.1:8300;
- proxy_set_header Accept-Encoding "";
- proxy_method GET;
- }
- location /video{
- welcome_video;
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- }
- }
- #mac black list info server
- server {
- #server for mac black list
- listen 1183;
- server_name _;
- access_log off;
- #TODO: disable debug
- #access_log /userdisk/sysapihttpd/log/blacklist.access.log main;
- #error_log /userdisk/sysapihttpd/log/error.log notice;
- error_log /dev/null notice;
- log_not_found off;
- root /data/nginx/htdocs/blacklist/;
- index index.html index.htm;
- add_header MiCGI-Status BLACKLIST;
- location = /stat/proxy.shtml {
- #
- include 'stat.conf';
- #
- }
- #error_page 404 /404.html;
- }
- server {
- #request info/stat server
- listen 127.0.0.1:5081;
- server_name _;
- access_log off;
- log_not_found off;
- keepalive_timeout 0;
- #
- root /etc/nginx/htdocs/;
- index index.html index.htm;
- #
- #
- include 'stat.conf';
- #
- }
- server {
- listen 8192;
- add_header Safe-Mark 'xiaomi';
- server_name _;
- #error_log /userdisk/data/safe.log debug;
- access_log off;
- resolver 127.0.0.1 valid=30s;
- location / {
- set_escape_uri $params $scheme://$host$request_uri;
- rewrite ^ http://miwifi.com/cgi-bin/luci/web/safeurl?safeurl=${params}? break;
- }
- }
- preload_zone zone=web_preload_zone:16k;
- server {
- listen 8193;
- server_name _;
- #error_log /userdisk/sysapihttpd/log/error.log info;
- access_log off;
- location / {
- add_header Cache-Mark 'xiaomi';
- preload /userdisk/cachecenter/cache_dir/ /http_proxy/ web_preload_zone;
- }
- resolver 127.0.0.1 valid=30s;
- location /http_proxy {
- internal;
- add_header Proxy-Mark 'xiaomi';
- rewrite /http_proxy/ / break;
- proxy_pass http://$http_host$request_uri;
- }
- }
- server {
- listen 127.0.0.1:8194;
- preload_statistics web_preload_zone;
- }
- ad_filter_zone zone=ad_filter_zone:16k;
- server {
- listen 127.0.0.1:8195;
- #error_log /userdisk/sysapihttpd/log/error.log info;
- ad_filter_statistics ad_filter_zone;
- }
- server {
- listen 8196;
- # resolver 8.8.8.8;
- resolver 127.0.0.1 valid=30s;
- log_format proxy_log '"$server_addr"\t"$host"\t"$remote_addr"\t"$time_local"\t"$request_method $request_uri"\t"$status"\t"$request_length"\t"$bytes_sent"\t"$request_time"\t"$sent_http_ MiCGI_Cache_Status"\t"$upstream_addr"\t"$upstream_response_time"\t"$http_referer"\t"$http_user_agent"';
- access_log off;
- #access_log /userdisk/data/proxy_8194.log proxy_log;
- #error_log /userdisk/sysapihttpd/log/error.log info;
- location / {
- add_header AD-Mark 'xiaomi';
- ad_filter /proxy/ ad_filter_zone;
- }
- location /proxy {
- internal;
- add_header Proxy-Mark 'xq-proxy';
- rewrite /proxy/ / break;
- proxy_pass http://$http_host$request_uri;
- }
- }
- server {
- listen 8999;
- location /{
- welcome_upstream;
- welcome_upstream_config_file_path /userdisk/appdata/2882303761517185825/etc/plugin_config;
- }
- error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /www/err/;
- }
- location = /404.html {
- root /www/err/;
- }
- }
- }
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement