Skip to content

Instantly share code, notes, and snippets.

@jhseodev
jhseodev / test_nginx.md
Last active June 21, 2021 22:20
nginx test

Test nginx SSL directive

1. proxy_ssl_verify_depth (ssl_verify_depth)

description

Syntax:	 proxy_ssl_verify_depth number;
Default: proxy_ssl_verify_depth 1;
Context: http, server, location
This directive appeared in version 1.7.0.

Sets the verification depth in the proxied HTTPS server certificates chain.
@jhseodev
jhseodev / nginx_map_parser.py
Created December 3, 2019 01:13
nginx map parser
from reconfigure.parsers import NginxParser
conf = '''map $ssl_server_name $proxy_tcp {
hostnames;
default upstream_tcp;
*.test.com upstream_tcp2;
"~*test[1-9].com" upstream_tcp3;
}
'''
@jhseodev
jhseodev / luaF.c
Last active March 11, 2021 23:57 — forked from jarcode-foss/luaF.c
fast split function for Lua
// Faster split method, the only alternative within lua is using gsub, which
// is insanely slower. This function will actually return strings on the stack,
// so {str:split(d)} can be used to collect the return values in a table
//
// A more memory effecient use would be to use string.fsplit rather than using
// a table construct
//
// this avoids extra memory bloat and will keep the resulting strings on the stack
//
// Build:
@jhseodev
jhseodev / epoll_server.py
Created October 25, 2022 23:55 — forked from dtoma/epoll_server.py
epoll tcp server in python
#!/usr/bin/env python
"""Simple server using epoll."""
from __future__ import print_function
from contextlib import contextmanager
import socket
import select