As The last ship sailed towards the distant horizon I sat there watching on a rock My mind slowly drifting away Forming into my... Dreamtale
Nginx revers proxy OpenWRT LEDE Koolshare Page
2018-12-01 / 2 min read

I'm using firmware form http://firmware.koolshare.cn/LEDE_X64_fw867/

Their softcenter's resources not same with LEDE luci, so I record my nginx config file here.

user root root;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        lo:gs/nginx.pid;


<!-- more -->

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    #default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
    	listen	     80;
    	server_name jet.stb.com;

    	location = / {
            proxy_http_version 1.1;
       	    proxy_pass http://127.0.0.1:1027;
    	    proxy_redirect off;
    	    proxy_set_header Host $host;
    	    proxy_set_header X-Real-IP $remote_addr;
    
    	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    	}

    }

    server {
        listen       80;
        server_name  localhost, wrt.stb.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location = / {
	        proxy_pass http://127.0.0.1:8090/cgi-bin/luci;
	    }

    	location /cgi-bin/luci {
    	    proxy_pass http://127.0.0.1:8090/cgi-bin/luci;
    	}
    
    	location /luci-static/ {
    	    proxy_pass http://127.0.0.1:8090/luci-static/;
    	}
    
    	location /css/  {
         	root /koolshare/webs;
        }
    
    	location /js/ {
    	    root /koolshare/webs;
    	}
    
    	location /layer/ {
    	    root /koolshare/webs;
    	}
    
    	location /files/ {
    	    root /koolshare/webs;
    	}
    
    	location /res/ {
    	    root /koolshare/webs;
    	}
    
    	location ~ \.asp?$ {
    	    root /koolshare/webs;
    	}
    
    	location /_api/ {
    	    proxy_http_version 1.1;
    	    proxy_pass http://127.0.0.1:8090/_api/;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
    
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    	}
}