Skip to content

Instantly share code, notes, and snippets.

@parruda
parruda / nginx.conf
Created December 10, 2023 03:19 — forked from marklkelly/nginx.conf
OpenResty & ssl_certificate_by_lua_file example
#Simplified for illustrative purposes.
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
-- Setup Redis connection
local redis = require "resty.redis"
local red = redis:new()
local ok, err = red:connect("127.0.0.1", "6379")
if not ok then
ngx.log(ngx.INFO, "REDIS: Failed to connect to redis: " .. err)
return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end