Created
June 2, 2016 10:25
-
-
Save Profpatsch/e27373dfe346dc4e59838860ba3982f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{ pkgs, config, lib, ... }: | |
let | |
isso = rec { | |
port = "8081"; | |
website = pkgs.runCommand "isso-test-html" {} '' | |
mkdir -p $out | |
echo ' | |
<p>test1232</p> | |
<script data-isso="/isso" | |
src="/static/js/embed.dev.js"></script> | |
<section id="isso-thread"></section> | |
' > $out/index.html | |
''; | |
}; | |
in | |
{ | |
services.nginx = { | |
enable = true; | |
httpConfig = '' | |
server { | |
server_name localhost; | |
location / { | |
root ${isso.website}; | |
} | |
location /static/js/ { | |
alias ${pkgs.isso.js}/; | |
} | |
location /isso { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Script-Name /isso; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://localhost:${isso.port}; | |
} | |
} | |
''; | |
}; | |
services.isso = { | |
enable = true; | |
config = { | |
general.host = [ "localhost" ]; | |
otherConfig = { | |
server.listen = "http://localhost:${isso.port}"; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment