|
| 1 | +# When searching for a virtual server by name, if name matches more than one of the specified variants, e.g. |
| 2 | +# both wildcard name and regular expression match, the first matching variant will be chosen, in the following |
| 3 | +# order of precedence: |
| 4 | +# |
| 5 | +# 1. exact name |
| 6 | +# 2. longest wildcard name starting with an asterisk, e.g. “*.example.org” |
| 7 | +# 3. longest wildcard name ending with an asterisk, e.g. “mail.*” |
| 8 | +# 4. first matching regular expression (in order of appearance in a configuration file) |
| 9 | + |
| 10 | +server { |
| 11 | + listen 80; |
| 12 | + server_name localhost; |
| 13 | + |
| 14 | + location / { |
| 15 | + proxy_pass http://peerprep-frontend:3000/; |
| 16 | + proxy_set_header Host $host; |
| 17 | + proxy_set_header X-Real-IP $remote_addr; |
| 18 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 19 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 20 | + } |
| 21 | + |
| 22 | + location /api/v1/questions/ { |
| 23 | + proxy_pass http://peerprep-questions-service:4000/api/v1/questions/; |
| 24 | + proxy_set_header Host $host; |
| 25 | + proxy_set_header X-Real-IP $remote_addr; |
| 26 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 27 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 28 | + } |
| 29 | + |
| 30 | + location /api/v1/users/ { |
| 31 | + proxy_pass http://peerprep-users-service:6969/api/v1/users/; |
| 32 | + proxy_set_header Host $host; |
| 33 | + proxy_set_header X-Real-IP $remote_addr; |
| 34 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 35 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 36 | + } |
| 37 | + |
| 38 | + location /api/v1/innkeeper/ { |
| 39 | + proxy_pass http://peerprep-innkeeper-service:4100/api/v1/innkeeper/; |
| 40 | + proxy_set_header Host $host; |
| 41 | + proxy_http_version 1.1; |
| 42 | + proxy_set_header Upgrade $http_upgrade; |
| 43 | + proxy_set_header Connection "upgrade"; |
| 44 | + proxy_set_header X-Real-IP $remote_addr; |
| 45 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 46 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 47 | + } |
| 48 | + |
| 49 | + location /api/v1/execute/ { |
| 50 | + include /etc/nginx/fastcgi_params; |
| 51 | + fastcgi_pass peerprep-executor-service:9000; |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +# Catch-all for unrecognised requests |
| 56 | +server { |
| 57 | + listen 80 default_server; |
| 58 | + server_name _; |
| 59 | + return 444; |
| 60 | +} |
0 commit comments