diff options
| author | Adam Soltys <[email protected]> | 2021-07-19 21:20:58 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-07-19 21:21:03 -0700 |
| commit | 6005bddcda0a7e9295ab42165a7aafffb3960ee3 (patch) | |
| tree | cd3820f9e68fac88ca7c2f151ae0912536e7955a | |
| parent | 13e1b068ca7ee1ce9cc06285e359081e5022e402 (diff) | |
| download | coinos-server-6005bddcda0a7e9295ab42165a7aafffb3960ee3.tar.gz coinos-server-6005bddcda0a7e9295ab42165a7aafffb3960ee3.zip | |
nginx conf
| -rw-r--r-- | .env.sample | 1 | ||||
| -rw-r--r-- | docker-compose.yml | 15 | ||||
| -rw-r--r-- | sampleconfig/nginx/default.conf.template | 38 |
3 files changed, 48 insertions, 6 deletions
diff --git a/.env.sample b/.env.sample index 1208e287..9678b5e0 100644 --- a/.env.sample +++ b/.env.sample @@ -12,3 +12,4 @@ LIQUID_ESPLORA_URL=http://localhost:5005 LIQUID_ESPLORA_PORT=5005 LIQUID_ELECTRS_URL=http://localhost:3012 ROOT_PASSWORD=password +HOST=dev.coinos.io diff --git a/docker-compose.yml b/docker-compose.yml index 434d3721..fa520942 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,15 @@ version: '3.6' services: - ui: - container_name: ui - image: asoltys/coinos-ui - ports: - - '8085:8085' + nginx: + container_name: nginx + image: nginx + ports: + - 80:80 + volumes: + - ./config/nginx:/etc/nginx/templates + - ../coinos-ui/dist:/coinos environment: - NODE_ENV: production + NGINX_HOST: wow.coinos.io app: container_name: app image: asoltys/coinos-server diff --git a/sampleconfig/nginx/default.conf.template b/sampleconfig/nginx/default.conf.template new file mode 100644 index 00000000..453f368f --- /dev/null +++ b/sampleconfig/nginx/default.conf.template @@ -0,0 +1,38 @@ +server { + listen 80; + server_name .${NGINX_HOST}; + server_tokens off; + + location @rewrites { + rewrite ^(.+)$ /index.html last; + } + + location / { + root /coinos; + index index.html; + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $remote_addr; + rewrite ^ $request_uri?; + rewrite ^/api/(.*) /$1 break; + return 400; + proxy_pass http://app:3119$uri$is_args; + } + + location /ws { + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + rewrite ^/ws/(.*) /$1 break; + + proxy_pass http://app:3119; + } +} |
