Skip to content
Snippets Groups Projects

Esap gateway query

Merged Nico Vermaas requested to merge esap-gateway-query into master
9 files
+ 299
59
Compare changes
  • Side-by-side
  • Inline
Files
9
# nginx configuration for esap
# note how this connects directly into the esap_api container on port 8000,
# note how this connects directly into the esap_api container on port 8000,
# this is made possible by the docker-compose 'network:' configuration.
upstream backend {
@@ -9,10 +9,10 @@ upstream backend {
server esap_api:8000;
}
upstream frontend {
# note that this is the container name from the docker-compose.yml, and it uses the internal port because we are on a docker network
server esap-gui:80;
}
#upstream frontend {
# # note that this is the container name from the docker-compose-query.yml, and it uses the internal port because we are on a docker network
# server esap-gui:80;
#}
server {
server_name localhost;
@@ -22,32 +22,47 @@ server {
root /shared/public_html;
location /esap-gui/ {
proxy_pass http://frontend/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_intercept_errors on;
recursive_error_pages on;
error_page 404 = @fallback;
}
# ===== esap-gui (frontend) configuration =====
# location /esap-gui/ {
# proxy_pass http://frontend/;
#
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_intercept_errors on;
# recursive_error_pages on;
# error_page 404 = @fallback;
# }
# This construction makes it possible to have a 'try_files' combined with a 'proxy_pass'.
# So when a request like "http://sdc.astron.nl/esap-gui/vo-query" fails, because 'vo-query' is not a backend location,
# then the 'error_page' forwards it to a 'try_files', which forwards it to the esap-gui frontend. (where the 'vo-query' route is defined).
location @fallback {
try_files $uri $uri/ /esap-gui/index.html;
}
# location @fallback {
# try_files $uri $uri/ /esap-gui/index.html;
# }
# ===== proxy to esap-api on port 8000 =====
location /esap-api/ {
proxy_pass http://backend/esap-api/;
proxy_set_header Host sdc.astron.nl;
proxy_set_header X-Forwarded-For $remote_addr;
# proxy the /static/ url to the frontend container
location /static/ {
# this proxies all calls to /static/ into the frontend container
#proxy_pass http://frontend/static/;
# this proxies all calls to /static/ to the shared static directory (in case of multiple frontends)
alias /static/;
}
# This reflects a change in the Django settings to serve multiple applications: STATIC_URL = '/static_esap/'
# ===== esap-api (backend) configuration =====
# uncomment when the frontend connects to '/esap-api' instead of to 'https://sdc.astron.nl:5555/esap-api'
# location /esap-api/ {
# proxy_pass http://backend/esap-api/;
# proxy_set_header Host sdc.astron.nl;
# proxy_set_header X-Forwarded-For $remote_addr;
# }
# This reflects the Django settings to serve multiple applications: STATIC_URL = '/static_esap/'
location /static_esap/ {
proxy_pass http://backend/static_esap/;
proxy_set_header Host sdc.astron.nl;
@@ -59,12 +74,8 @@ server {
proxy_pass http://backend/oidc/;
}
location /static/ {
alias /static/;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
Loading