Advertisement
Radkoski

WUS 1.4 nginx config

Dec 12th, 2022 (edited)
995
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.65 KB | None | 0 0
  1. upstream read_backend {
  2.     server READ_SERV_ADDR:READ_SERV_PORT;
  3. }
  4.  
  5. upstream write_backend {
  6.     server WRITE_SERV_ADDR:WRITE_SERV_PORT;
  7. }
  8.  
  9. log_format upstreamlog '[$time_local] to: $upstream_addr: $request $status upstream_response_time $upstream_response_time msec $msec request_time $request_time';
  10.  
  11.  
  12. server {
  13.     listen NGINX_PORT;
  14.     access_log /var/log/nginx/access.log upstreamlog;
  15.  
  16.     location /petclinic/api/ {
  17.         if ($request_method = GET) {
  18.             proxy_pass http://read_backend;
  19.         }
  20.  
  21.         if ($request_method != GET) {
  22.             proxy_pass http://write_backend;
  23.         }
  24.         include proxy_params;
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement