Skip to content

Instantly share code, notes, and snippets.

@mowtschan
Last active March 27, 2022 08:29
Show Gist options
  • Save mowtschan/6df70414a77620078684d249ab98272e to your computer and use it in GitHub Desktop.
Save mowtschan/6df70414a77620078684d249ab98272e to your computer and use it in GitHub Desktop.
Enable CORS on GL.iNet GL-MT300N-V2 (OpenWrt, lighttpd)
ssh [email protected]
opkg update
opkg install lighttpd-mod-setenv
vim /etc/lighttpd/conf.d/30-setenv.conf
# ---
server.modules += ( "mod_setenv" )
setenv.add-response-header = (
"Access-Control-Allow-Origin" => "<PUT HERE YOUR SITE, DON'T USE *>",
"Access-Control-Allow-Headers" => "accept, origin, x-requested-with, content-type, x-transmission-session-id, Authorization")
# ---
service lighttpd reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment