def quote(s: str) -> str:
    """
    Quotes a string and escapes special characters inside the string. It also removes $ from the string
    since those are not allowed in NGINX strings (unless referencing a variable).

    :param s: The string to quote
    :return: The quoted string
    """
    return "'" + s.replace("\\", "\\\\").replace("'", "\\'").replace("$", "") + "'"