Last active
October 6, 2021 11:23
-
-
Save stek29/ff25ee6aa50f9f50e90fc9b384c357c4 to your computer and use it in GitHub Desktop.
kpms msx http based api hack for older webOS devices - for LE root cert expiry workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name kp.local; | |
location = /msx/start.json { | |
proxy_pass https://kpms.cc; | |
proxy_http_version 1.1; | |
proxy_set_header Host "kpms.cc"; | |
proxy_set_header Cookie ""; | |
# disable gzip for sub_filter | |
proxy_set_header Accept-Encoding ""; | |
proxy_hide_header Strict-Transport-Security; | |
sub_filter_types application/json; | |
sub_filter_once off; | |
sub_filter 'https://kpms.cc' $scheme://$host; | |
} | |
location /static/js/ { | |
proxy_pass https://kpms.cc; | |
proxy_http_version 1.1; | |
proxy_set_header Host "kpms.cc"; | |
proxy_set_header Cookie ""; | |
proxy_hide_header Strict-Transport-Security; | |
# disable gzip for sub_filter | |
proxy_set_header Accept-Encoding ""; | |
sub_filter_types application/javascript; | |
sub_filter_once off; | |
sub_filter 'https://api.service-kp.com' $scheme://$host/A; | |
} | |
location /A/ { | |
proxy_pass https://api.service-kp.com/; | |
proxy_http_version 1.1; | |
proxy_set_header Host "api.service-kp.com"; | |
proxy_set_header Cookie ""; | |
proxy_hide_header Strict-Transport-Security; | |
access_log off; | |
proxy_cache off; | |
} | |
location ~ /A/v1/(items/media-links|tv) { | |
proxy_pass https://api.service-kp.com/v1/$1$is_args$args; | |
proxy_http_version 1.1; | |
proxy_set_header Host "api.service-kp.com"; | |
proxy_set_header Cookie ""; | |
proxy_hide_header Strict-Transport-Security; | |
access_log off; | |
proxy_cache off; | |
# disable gzip for sub_filter | |
proxy_set_header Accept-Encoding ""; | |
sub_filter_types application/json; | |
sub_filter_once off; | |
sub_filter 'https://' 'http://'; | |
} | |
location / { | |
proxy_pass https://kpms.cc; | |
proxy_http_version 1.1; | |
proxy_cache_bypass $http_upgrade; | |
proxy_hide_header Strict-Transport-Security; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host "kpms.cc"; | |
proxy_set_header Cookie ""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment