Skip to content

Instantly share code, notes, and snippets.

@wilyJ80
Last active May 24, 2024 18:08
Show Gist options
  • Save wilyJ80/ae939885eaecee1ba53c22aea56abfa7 to your computer and use it in GitHub Desktop.
Save wilyJ80/ae939885eaecee1ba53c22aea56abfa7 to your computer and use it in GitHub Desktop.
Lapis Nginx Config production notes
worker_processes ${{NUM_WORKERS}};
# Toggle in production
error_log stderr notice;
# Toggle in production
daemon off;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
init_by_lua_block {
require "lpeg"
}
server {
listen ${{PORT}};
# Toggle in production
lua_code_cache ${{CODE_CACHE}};
location / {
default_type text/html;
content_by_lua_block {
require("lapis").serve("app")
}
}
location /static/ {
alias static/;
}
location /favicon.ico {
alias static/favicon.ico;
}
}
}
# Read reference: https://leafo.net/lapis/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment