Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream read_backend {
- server READ_SERV_ADDR:READ_SERV_PORT;
- }
- upstream write_backend {
- server WRITE_SERV_ADDR:WRITE_SERV_PORT;
- }
- log_format upstreamlog '[$time_local] to: $upstream_addr: $request $status upstream_response_time $upstream_response_time msec $msec request_time $request_time';
- server {
- listen NGINX_PORT;
- access_log /var/log/nginx/access.log upstreamlog;
- location /petclinic/api/ {
- if ($request_method = GET) {
- proxy_pass http://read_backend;
- }
- if ($request_method != GET) {
- proxy_pass http://write_backend;
- }
- include proxy_params;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement