1
- # current sorry state of my nginx.conf file
2
1
worker_processes 1;
3
2
4
3
events {
@@ -7,65 +6,69 @@ events {
7
6
8
7
http {
9
8
include mime.types ;
9
+
10
10
default_type application/octet-stream ;
11
- # for caching of cookie
12
- proxy_cache_path cache/ keys_zone=auth_cache:1m ;
13
11
14
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
15
- # '$status $body_bytes_sent "$http_referer" '
16
- # '"$http_user_agent" "$http_x_forwarded_for"';
17
-
18
- #access_log logs/access.log main;
12
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
13
+ '$status $body_bytes_sent "$http_referer" '
14
+ '"$http_user_agent" "$http_x_forwarded_for"' ;
19
15
20
16
sendfile on;
21
17
#tcp_nopush on;
22
18
23
- #keepalive_timeout 0;
24
19
keepalive_timeout 65 ;
25
20
26
- #gzip on;
27
21
28
- server {
29
- listen 80 ;
30
- server_name localhost;
31
22
32
- # frontend (i guess login page)
33
- location / {
34
- proxy_pass http ://peerprep:3000 /; # frontend running on...similar for other services
35
- proxy_http_version 1.1;
36
- proxy_set_header Upgrade $http_upgrade ;
37
- proxy_set_header Connection "Upgrade" ;
38
- proxy_set_header Host $host ;
39
- proxy_cache_bypass $http_upgrade ;
40
- }
23
+ upstream peerprep {
24
+ server peerprep:3000 ;
25
+ }
41
26
42
- # question
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 ;
27
+ upstream user_service {
28
+ server user -service:3001 ;
29
+ }
49
30
31
+ upstream backend {
32
+ server backend:9090 ;
33
+ }
34
+
35
+ upstream matching_service_api {
36
+ server matching-service-api:9200 ;
37
+ }
38
+
39
+ upstream storage_blob_api {
40
+ server storage-blob-api:9300 ;
41
+ }
42
+
43
+ upstream collab {
44
+ server collab:4000 ;
45
+ }
46
+
47
+ server {
48
+ listen 80 ;
49
+ location / {
50
+ proxy_pass http ://peerprep/;
50
51
}
51
52
52
- # user (pure conjecture, just referencing gaylord article)
53
53
location /users/ {
54
- proxy_pass http ://user -service:3001 /;
55
- # auth_request auth;
56
- # auth_request_set $userid $upstream_http_x_auth_user;
57
-
58
- # # if fail go back to landing
59
- # if ($http_accept ~* "text/html" ) {
60
- # error_page 401 403 =200 /;
61
- # }
54
+ proxy_pass http ://user_service/;
62
55
63
- proxy_set_header X-Auth-User $userid ;
64
- proxy_set_header Host $host ;
65
- proxy_set_header X-Forwarded-For $remote_addr ;
56
+ }
66
57
58
+ location /backend/ {
59
+ proxy_pass http ://backend/;
60
+ }
67
61
62
+ location /matchmaking/ {
63
+ proxy_pass http ://matching_service_api/;
68
64
}
69
65
66
+ location /blob/ {
67
+ proxy_pass http ://storage_blob_api/;
68
+ }
69
+
70
+ location /collab/ {
71
+ proxy_pass http ://collab/;
72
+ }
70
73
}
71
74
}
0 commit comments