Guest User

Untitled

a guest
Feb 8th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. http {
  2. upstream database {
  3. postgres_server 127.0.0.1 dbname=stardb user=username password=yourpass;
  4. }
  5.  
  6.  
  7. server {
  8. listen 80 default_server;
  9. listen [::]:80 default_server;
  10.  
  11. location /ip {
  12. postgres_pass database;
  13. rds_json on;
  14.  
  15. #postgres_query HEAD GET "SELECT * FROM establishment_view;
  16. postgres_query HEAD GET "SELECT http_host as ip FROM establishment_view where aet = 'NXS_DEV_FLO2'";
  17. }
  18.  
  19. location /port {
  20. postgres_pass database;
  21. rds_json on;
  22.  
  23. postgres_query HEAD GET "SELECT coalesce(http_port, '80') as port FROM establishment_view where aet = 'NXS_DEV_FLO2'";
  24. }
Add Comment
Please, Sign In to add comment