Skip to content

MechanisM/ngx_postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABOUT:
------
ngx_postgres is an upstream module that allows nginx
to communicate directly with PostgreSQL database.

Response is generated in RDS format, so it's compatible with:
rds_json, ngx_drizzle and ngx_oracle modules.


CONFIGURATION DIRECTIVES:
-------------------------

  postgres_server ip[:port] dbname=dbname user=user password=pass (context: upstream)
  -----------------------------------------------------------------------------------
  default: none

  postgres_keepalive off | max=count [mode=single|multi] [overflow=ignore|reject] (context: upstream)
  --------------------------------------------------------------------------------------------------- 
  default: max=10 mode=single overflow=ignore

  postgres_pass upstream (context: http, server, location)
  --------------------------------------------------------
  default: none

  postgres_query query (context: http, server, location)
  ------------------------------------------------------
  default: none

  postgres_connect_timeout timeout (context: http, server, location)
  ------------------------------------------------------------------
  default: 10s

  postgres_result_timeout timeout (context: http, server, location)
  -----------------------------------------------------------------
  default: 30s


EXAMPLE CONFIGURATION:
----------------------
http {
    upstream database {
        postgres_server  127.0.0.1 dbname=test
                         user=monty password=some_pass;
    }

    server {
        location / {
            postgres_pass   database;
            postgres_query  "select * from cats";
        }
    }
}

About

upstream module that allows nginx to communicate directly with PostgreSQL database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published