Skip to content

Commit

Permalink
Merge pull request #926 from neuroscout/gzip
Browse files Browse the repository at this point in the history
FIX: Nginx routing for gzip enable
  • Loading branch information
adelavega committed May 4, 2021
2 parents 5bfecf8 + e38c2ba commit ac7e2d6
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,48 @@ http {
alias /file-data/reports;
}

location = /api {
return 301 /swagger-ui/;
}

location = /api/ {
return 301 /api/swagger/;
return 301 /swagger-ui/;
}

location = /api {
return 301 /api/swagger/;
location = /api/swagger {
return 301 /swagger-ui/;
}

location /api/swagger/ {
location /swagger-ui/ {
proxy_pass http://swagger-ui:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location = / {
root /neuroscout/neuroscout/frontend/build;
try_files /index.html =404;
location /swagger {
proxy_pass http://neuroscout:8000/swagger;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 75s;
proxy_read_timeout 300s;
}

location ^~ / {
proxy_pass http://neuroscout:8000/;
location ~/api/(.*)$ {
proxy_pass http://neuroscout:8000/api/$1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 75s;
proxy_read_timeout 300s;
}

location / {
root /neuroscout/neuroscout/frontend/build;
try_files $uri /index.html =404;
}

}
}

0 comments on commit ac7e2d6

Please sign in to comment.