31
31
32
32
# frontend (i guess login page)
33
33
location / {
34
- proxy_pass http ://localhost :3000 /; # frontend running on...similar for other services
34
+ proxy_pass http ://peerprep :3000 /; # frontend running on...similar for other services
35
35
proxy_http_version 1.1;
36
36
proxy_set_header Upgrade $http_upgrade ;
37
37
proxy_set_header Connection "Upgrade" ;
@@ -40,35 +40,32 @@ http {
40
40
}
41
41
42
42
# question
43
- location /api/ {
44
- proxy_pass http ://localhost:9090 /;
43
+ location ~ ^/api/( ?!internal ) .*$ {
44
+ proxy_pass http ://backend:9090 /;
45
+ proxy_set_header Host $host ;
46
+ proxy_set_header X-Real-IP $remote_addr ;
47
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
48
+ proxy_set_header X-Forwarded-Proto $scheme ;
49
+
45
50
}
46
51
47
- # # user (pure conjecture, just referencing gaylord article)
48
- # location /users/ {
49
- # auth_request auth;
50
- # auth_request_set $userid $upstream_http_x_auth_user;
52
+ # user (pure conjecture, just referencing gaylord article)
53
+ location /users/ {
54
+ proxy_pass http ://user -service:3001 /;
55
+ # auth_request auth;
56
+ # auth_request_set $userid $upstream_http_x_auth_user;
51
57
52
- # # if fail go back to landing
53
- # if ($http_accept ~* "text/html" ) {
54
- # error_page 401 403 =200 /;
55
- # }
56
- # proxy_set_header X-Auth-User $userid;
57
- # proxy_set_header Host $host;
58
- # proxy_set_header X-Forwarded-For $remote_addr;
59
- # proxy_pass http://localhost:3001/;
60
-
61
- # }
62
-
63
- # location = auth {
64
- # internal;
65
- # # proxy_pass to authenticator service
66
- # proxy_set_header Content-Length "";
67
- # proxy_set_header X-Dbg $cookie_AUTH;
68
-
69
- # proxy_cache auth_cache;
70
- # proxy_cache_valid 200 204 1m;
71
- # proxy_cache_key "$http_authorization"; # jwt?
72
- # }
58
+ # # if fail go back to landing
59
+ # if ($http_accept ~* "text/html" ) {
60
+ # error_page 401 403 =200 /;
61
+ # }
62
+
63
+ proxy_set_header X-Auth-User $userid ;
64
+ proxy_set_header Host $host ;
65
+ proxy_set_header X-Forwarded-For $remote_addr ;
66
+
67
+
68
+ }
69
+
73
70
}
74
71
}
0 commit comments