-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from rwblair/nginx_updates
Nginx updates
- Loading branch information
Showing
10 changed files
with
80 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,5 @@ ENV/ | |
|
||
# OS generated files | ||
.DS_Store | ||
|
||
.ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
# mriqcwebapi | ||
Built on: | ||
* [Python Eve](http://python-eve.org/) | ||
* [Python Gunicorn](http://gunicorn.org/) | ||
* [Nginx](https://nginx.org/) | ||
* [Docker](https://www.docker.com/) | ||
|
||
## Run | ||
Example of commands to run locally to start: | ||
```sh | ||
$ cd dockereve-master/ | ||
$ docker-compose build | ||
$ docker-compose up -d | ||
$ curl -i -H "Content-Type: application/json" http://localhost/api/v1/T1w | ||
``` | ||
|
||
Swagger API documentation available at `http://localhost/docs`. | ||
|
||
## Environment variables in Docker | ||
To properly run the file dockereve-master/.env needs to be populated the following are the default values: | ||
``` | ||
MONGODB_HOST=mongodb | ||
MONGODB_PORT=27017 | ||
API_TOKEN=<secret_token> | ||
API_URL=http://localhost/docs/api | ||
``` | ||
|
||
If docker is running natively these values should work, otherwise API_URL may need to be updated from localhost accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
user nginx; | ||
worker_processes 1; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
listen [::]:80 ; | ||
server_name 34.224.227.208; | ||
|
||
location = /docs/api { | ||
proxy_pass http://eve:5000/docs/api; | ||
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 /api { | ||
proxy_pass http://eve:5000; | ||
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 / { | ||
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; | ||
} | ||
#return 301 https://$host$request_uri; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.