free ourselves from the shackles of openresty
This commit is contained in:
parent
f8de5f317f
commit
b43f36d623
4 changed files with 10 additions and 90 deletions
|
@ -16,13 +16,10 @@ in {
|
|||
# actually enables nginx, configures acme,
|
||||
# gzip, optimization, proxy, ssl config,
|
||||
# opens ports, and adds some Headers
|
||||
nginx-config = {
|
||||
enable = true;
|
||||
defaultLuaPackagePath = /var/www/reidlab.online/lua;
|
||||
};
|
||||
nginx-config.enable = true;
|
||||
|
||||
staticSites = {
|
||||
"v2.reidlab.online".dataDir = "/var/www/v2.reidlab.online";
|
||||
"reidlab.online".dataDir = "/var/www/reidlab.online";
|
||||
};
|
||||
|
||||
metrics = {
|
||||
|
@ -36,30 +33,12 @@ in {
|
|||
services = {
|
||||
nginx.virtualHosts = {
|
||||
"reidlab.online" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "/var/www/reidlab.online/public";
|
||||
locations."/f/".extraConfig = ''
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
'';
|
||||
# we should perhaps add something to help with this in staticsites?
|
||||
extraConfig = ''
|
||||
error_page 404 /errors/404.html;
|
||||
error_page 403 /errors/403.html;
|
||||
error_page 500 /errors/500.html;
|
||||
location = /errors/404.html { root /var/www/reidlab.online/public/; internal; }
|
||||
location = /errors/403.html { root /var/www/reidlab.online/public/; internal; }
|
||||
location = /errors/500.html { root /var/www/reidlab.online/public/; internal; }
|
||||
|
||||
location / {
|
||||
try_files $uri @main;
|
||||
}
|
||||
|
||||
location /chat {
|
||||
access_by_lua_file /var/www/reidlab.online/lua/chat.lua;
|
||||
}
|
||||
|
||||
location @main {
|
||||
content_by_lua '
|
||||
require("main").handle_request()
|
||||
';
|
||||
}
|
||||
error_page 404 /404.html;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue