Compare commits
20 Commits
v2.3.0-rc6
...
v2.3.0-rc7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80ec15193c | ||
|
|
d61eba8c68 | ||
|
|
4787b6353a | ||
|
|
debcd1808e | ||
|
|
85f471ad08 | ||
|
|
c7fa785346 | ||
|
|
a710934830 | ||
|
|
69e006f640 | ||
|
|
78c32af062 | ||
|
|
9a47191e10 | ||
|
|
ace5da94a4 | ||
|
|
e7f2f75b05 | ||
|
|
5b39ad2130 | ||
|
|
ee1985bb3d | ||
|
|
9caa57e81d | ||
|
|
8797ef261f | ||
|
|
fb9a548dfc | ||
|
|
ad4bfefee7 | ||
|
|
cd9157488f | ||
|
|
b501f7228c |
@@ -49,9 +49,9 @@ Note: the IP in the example above refers to Docker's default gateway IP address
|
||||
|
||||
You can check if the instance is running by visiting http://localhost - the graphs will be populated as new transactions are detected.
|
||||
|
||||
## bitcoind+romanz/electrs configuration
|
||||
## bitcoind+electrum configuration
|
||||
|
||||
In order to run with `romanz/electrs` as the backend, in addition to the settings required for running with `bitcoind` above, you will need to make the following changes to the `docker-compose.yml` file:
|
||||
In order to run with a `electrum` compatible server as the backend, in addition to the settings required for running with `bitcoind` above, you will need to make the following changes to the `docker-compose.yml` file:
|
||||
|
||||
- Under the `api` service, change the value of the `MEMPOOL_BACKEND` key from `none` to `electrum`:
|
||||
|
||||
@@ -68,10 +68,10 @@ In order to run with `romanz/electrs` as the backend, in addition to the setting
|
||||
environment:
|
||||
ELECTRUM_HOST: "172.27.0.1"
|
||||
ELECTRUM_PORT: "50002"
|
||||
ELECTRUM_TLS: "false"
|
||||
ELECTRUM_TLS_ENABLED: "false"
|
||||
```
|
||||
|
||||
You can update any of the backend settings in the `mempool-config.json` file using the following environment variables to override them.
|
||||
You can update any of the backend settings in the `mempool-config.json` file using the following environment variables to override them under the same `api` `environment` section.
|
||||
|
||||
JSON:
|
||||
```
|
||||
|
||||
12
backend/package-lock.json
generated
12
backend/package-lock.json
generated
@@ -577,9 +577,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.14.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz",
|
||||
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==",
|
||||
"version": "1.14.7",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
|
||||
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -1877,9 +1877,9 @@
|
||||
}
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.14.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz",
|
||||
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A=="
|
||||
"version": "1.14.7",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
|
||||
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ=="
|
||||
},
|
||||
"forwarded": {
|
||||
"version": "0.1.2",
|
||||
|
||||
@@ -247,9 +247,8 @@ class Statistics {
|
||||
}
|
||||
|
||||
private getQueryForDaysAvg(div: number, interval: string) {
|
||||
return `SELECT id, UNIX_TIMESTAMP(added) as added,
|
||||
CAST(avg(unconfirmed_transactions) as DOUBLE) as unconfirmed_transactions,
|
||||
CAST(avg(tx_per_second) as DOUBLE) as tx_per_second,
|
||||
return `SELECT
|
||||
UNIX_TIMESTAMP(added) as added,
|
||||
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
|
||||
CAST(avg(vsize_1) as DOUBLE) as vsize_1,
|
||||
CAST(avg(vsize_2) as DOUBLE) as vsize_2,
|
||||
@@ -292,12 +291,12 @@ class Statistics {
|
||||
FROM statistics \
|
||||
WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \
|
||||
GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \
|
||||
ORDER BY added DESC;`;
|
||||
ORDER BY statistics.added DESC;`;
|
||||
}
|
||||
|
||||
private getQueryForDays(div: number, interval: string) {
|
||||
return `SELECT id, UNIX_TIMESTAMP(added) as added, unconfirmed_transactions,
|
||||
tx_per_second,
|
||||
return `SELECT
|
||||
UNIX_TIMESTAMP(added) as added,
|
||||
CAST(avg(vbytes_per_second) as DOUBLE) as vbytes_per_second,
|
||||
vsize_1,
|
||||
vsize_2,
|
||||
@@ -340,7 +339,7 @@ class Statistics {
|
||||
FROM statistics \
|
||||
WHERE added BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() \
|
||||
GROUP BY UNIX_TIMESTAMP(added) DIV ${div} \
|
||||
ORDER BY added DESC;`;
|
||||
ORDER BY statistics.added DESC;`;
|
||||
}
|
||||
|
||||
private async $get(id: number): Promise<OptimizedStatistic | undefined> {
|
||||
@@ -360,7 +359,7 @@ class Statistics {
|
||||
public async $list2H(): Promise<OptimizedStatistic[]> {
|
||||
try {
|
||||
const connection = await DB.pool.getConnection();
|
||||
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY added DESC LIMIT 120`;
|
||||
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY statistics.added DESC LIMIT 120`;
|
||||
const [rows] = await connection.query<any>({ sql: query, timeout: this.queryTimeout });
|
||||
connection.release();
|
||||
return this.mapStatisticToOptimizedStatistic(rows);
|
||||
@@ -373,7 +372,7 @@ class Statistics {
|
||||
public async $list24H(): Promise<OptimizedStatistic[]> {
|
||||
try {
|
||||
const connection = await DB.pool.getConnection();
|
||||
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY added DESC LIMIT 1440`;
|
||||
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY statistics.added DESC LIMIT 1440`;
|
||||
const [rows] = await connection.query<any>({ sql: query, timeout: this.queryTimeout });
|
||||
connection.release();
|
||||
return this.mapStatisticToOptimizedStatistic(rows);
|
||||
@@ -477,10 +476,7 @@ class Statistics {
|
||||
private mapStatisticToOptimizedStatistic(statistic: Statistic[]): OptimizedStatistic[] {
|
||||
return statistic.map((s) => {
|
||||
return {
|
||||
id: s.id || 0,
|
||||
added: s.added,
|
||||
unconfirmed_transactions: s.unconfirmed_transactions,
|
||||
tx_per_second: s.tx_per_second,
|
||||
vbytes_per_second: s.vbytes_per_second,
|
||||
mempool_byte_weight: s.mempool_byte_weight,
|
||||
total_fee: s.total_fee,
|
||||
|
||||
@@ -221,6 +221,24 @@ class Server {
|
||||
res.status(500).end();
|
||||
}
|
||||
})
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'translators', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get('https://mempool.space/api/v1/translators', { responseType: 'stream', timeout: 10000 });
|
||||
response.data.pipe(res);
|
||||
} catch (e) {
|
||||
res.status(500).end();
|
||||
}
|
||||
})
|
||||
.get(config.MEMPOOL.API_URL_PREFIX + 'translators/images/:id', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get('https://mempool.space/api/v1/translators/images/' + req.params.id, {
|
||||
responseType: 'stream', timeout: 10000
|
||||
});
|
||||
response.data.pipe(res);
|
||||
} catch (e) {
|
||||
res.status(500).end();
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {
|
||||
|
||||
@@ -128,10 +128,7 @@ export interface Statistic {
|
||||
}
|
||||
|
||||
export interface OptimizedStatistic {
|
||||
id: number;
|
||||
added: string;
|
||||
unconfirmed_transactions: number;
|
||||
tx_per_second: number;
|
||||
vbytes_per_second: number;
|
||||
total_fee: number;
|
||||
mempool_byte_weight: number;
|
||||
|
||||
1851
frontend/package-lock.json
generated
1851
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -163,6 +163,20 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="translators$ | async | keyvalue as translators else loadingSponsors">
|
||||
<div class="community-sponsor">
|
||||
<h3 i18n="about.translators">Project Translators</h3>
|
||||
<div class="wrapper">
|
||||
<ng-template ngFor let-translator [ngForOf]="translators">
|
||||
<a [href]="'https://twitter.com/' + translator.value" target="_blank" [title]="translator.key">
|
||||
<img class="image" [src]="'/api/v1/translators/images/' + translator.value" />
|
||||
</a>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="allContributors$ | async as contributors else loadingSponsors">
|
||||
<div class="contributors">
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ApiService } from 'src/app/services/api.service';
|
||||
import { IBackendInfo } from 'src/app/interfaces/websocket.interface';
|
||||
import { Router } from '@angular/router';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ITranslators } from 'src/app/interfaces/node-api.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'app-about',
|
||||
@@ -17,6 +18,7 @@ import { map } from 'rxjs/operators';
|
||||
export class AboutComponent implements OnInit {
|
||||
backendInfo$: Observable<IBackendInfo>;
|
||||
sponsors$: Observable<any>;
|
||||
translators$: Observable<ITranslators>;
|
||||
allContributors$: Observable<any>;
|
||||
frontendGitCommitHash = this.stateService.env.GIT_COMMIT_HASH;
|
||||
packetJsonVersion = this.stateService.env.PACKAGE_JSON_VERSION;
|
||||
@@ -38,6 +40,17 @@ export class AboutComponent implements OnInit {
|
||||
this.websocketService.want(['blocks']);
|
||||
|
||||
this.sponsors$ = this.apiService.getDonation$();
|
||||
this.translators$ = this.apiService.getTranslators$()
|
||||
.pipe(
|
||||
map((translators) => {
|
||||
for (const t in translators) {
|
||||
if (translators[t] === '') {
|
||||
delete translators[t]
|
||||
}
|
||||
}
|
||||
return translators;
|
||||
})
|
||||
);
|
||||
this.allContributors$ = this.apiService.getContributor$().pipe(
|
||||
map((contributors) => {
|
||||
return {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
export interface OptimizedMempoolStats {
|
||||
id: number;
|
||||
added: number;
|
||||
unconfirmed_transactions: number;
|
||||
tx_per_second: number;
|
||||
vbytes_per_second: number;
|
||||
total_fee: number;
|
||||
mempool_byte_weight: number;
|
||||
@@ -52,3 +49,5 @@ export interface LiquidPegs {
|
||||
amount: string;
|
||||
date: string;
|
||||
}
|
||||
|
||||
export interface ITranslators { [language: string]: string; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { CpfpInfo, OptimizedMempoolStats, DifficultyAdjustment, AddressInformation, LiquidPegs } from '../interfaces/node-api.interface';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { CpfpInfo, OptimizedMempoolStats, DifficultyAdjustment, AddressInformation, LiquidPegs, ITranslators } from '../interfaces/node-api.interface';
|
||||
import { Observable } from 'rxjs';
|
||||
import { StateService } from './state.service';
|
||||
import { WebsocketResponse } from '../interfaces/websocket.interface';
|
||||
@@ -85,6 +85,10 @@ export class ApiService {
|
||||
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/donations');
|
||||
}
|
||||
|
||||
getTranslators$(): Observable<ITranslators> {
|
||||
return this.httpClient.get<ITranslators>(this.apiBaseUrl + this.apiBasePath + '/api/v1/translators');
|
||||
}
|
||||
|
||||
getContributor$(): Observable<any[]> {
|
||||
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/contributors');
|
||||
}
|
||||
|
||||
@@ -57,6 +57,12 @@
|
||||
location /api/v1/contributors/images {
|
||||
proxy_pass https://mempool.space;
|
||||
}
|
||||
location /api/v1/translators {
|
||||
proxy_pass https://mempool.space;
|
||||
}
|
||||
location /api/v1/translators/images {
|
||||
proxy_pass https://mempool.space;
|
||||
}
|
||||
location /api/v1/ws {
|
||||
proxy_pass http://127.0.0.1:8999/;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/var/log/nginx/access.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/error.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/bisq-access.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/bisq-error.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/liquid-access.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/liquid-error.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/mempool-access.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/mempool-error.log 644 10 * @T00 C /var/run/nginx.pid 30
|
||||
/var/log/nginx/access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/bisq-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/bisq-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/liquid-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/liquid-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/mempool-access.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
/var/log/nginx/mempool-error.log nobody:nobody 644 10 * @T00 C /var/run/mempool.pid 30
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env zsh
|
||||
hostname=$(hostname)
|
||||
while true
|
||||
do for url in /url/v1/statistics/2h \
|
||||
/url/v1/statistics/24h \
|
||||
/url/v1/statistics/1w \
|
||||
/url/v1/statistics/1m \
|
||||
/url/v1/statistics/3m \
|
||||
/url/v1/statistics/6m \
|
||||
/url/v1/statistics/1y \
|
||||
/url/v1/statistics/2y \
|
||||
/url/v1/statistics/3y \
|
||||
do for url in /api/v1/statistics/2h \
|
||||
/api/v1/statistics/24h \
|
||||
/api/v1/statistics/1w \
|
||||
/api/v1/statistics/1m \
|
||||
/api/v1/statistics/3m \
|
||||
/api/v1/statistics/6m \
|
||||
/api/v1/statistics/1y \
|
||||
/api/v1/statistics/2y \
|
||||
/api/v1/statistics/3y \
|
||||
/
|
||||
do
|
||||
curl -s "https://${hostname}${url}" >/dev/null
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
location /api/v1/contributors/images {
|
||||
proxy_pass https://mempool.space;
|
||||
proxy_cache services;
|
||||
proxy_cache_valid 200 1d;
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
location /api/v1/contributors {
|
||||
proxy_pass https://mempool.space;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
# don't rate limit this API prefix
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
location /api/v1/donations/images {
|
||||
proxy_pass https://mempool.space;
|
||||
proxy_cache services;
|
||||
proxy_cache_valid 200 1d;
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
location /api/v1/donations {
|
||||
proxy_pass https://mempool.space;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
# don't rate limit this API prefix
|
||||
}
|
||||
72
production/nginx/location-api-v1-services.conf
Normal file
72
production/nginx/location-api-v1-services.conf
Normal file
@@ -0,0 +1,72 @@
|
||||
location /api/v1/contributors/images {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1w;
|
||||
expires 1w;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
location /api/v1/contributors {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1d;
|
||||
expires 1d;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
location /api/v1/donations/images {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1w;
|
||||
expires 1w;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
location /api/v1/donations {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1d;
|
||||
expires 1d;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
location /api/v1/translators/images {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1w;
|
||||
expires 1w;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
location /api/v1/translators {
|
||||
proxy_pass $mempoolSpaceServices;
|
||||
proxy_cache services;
|
||||
proxy_cache_background_update on;
|
||||
proxy_cache_use_stale updating;
|
||||
proxy_cache_valid 200 1d;
|
||||
expires 1d;
|
||||
proxy_hide_header onion-location;
|
||||
proxy_hide_header strict-transport-security;
|
||||
proxy_hide_header content-security-policy;
|
||||
proxy_hide_header x-frame-options;
|
||||
}
|
||||
@@ -32,7 +32,14 @@ http {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name mempool.ninja;
|
||||
|
||||
# for services from mempool.space like contributors on about page
|
||||
set $mempoolSpaceServices "https://mempool.space";
|
||||
|
||||
# for mempool/backend daemon, see upstream-mempool.conf
|
||||
set $mempoolBackend "http://mempool-bitcoin-mainnet";
|
||||
|
||||
# for blockstream/electrs daemon, see upstream-electrs.conf
|
||||
set $electrsBackend "http://electrs-bitcoin-mainnet";
|
||||
|
||||
# tor v3
|
||||
@@ -59,7 +66,14 @@ http {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name bisq.ninja;
|
||||
|
||||
# for services from mempool.space like contributors on about page
|
||||
set $mempoolSpaceServices "https://mempool.space";
|
||||
|
||||
# for mempool/backend daemon, see upstream-mempool.conf
|
||||
set $mempoolBackend "http://mempool-bisq-mainnet";
|
||||
|
||||
# for blockstream/electrs daemon, see upstream-electrs.conf
|
||||
set $electrsBackend "http://electrs-bitcoin-mainnet";
|
||||
|
||||
# tor v3
|
||||
@@ -86,7 +100,14 @@ http {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name liquid.place;
|
||||
|
||||
# for services from mempool.space like contributors on about page
|
||||
set $mempoolSpaceServices "https://mempool.space";
|
||||
|
||||
# for mempool/backend daemon, see upstream-mempool.conf
|
||||
set $mempoolBackend "http://mempool-liquid-mainnet";
|
||||
|
||||
# for blockstream/electrs daemon, see upstream-electrs.conf
|
||||
set $electrsBackend "http://electrs-liquid-mainnet";
|
||||
|
||||
# tor v3
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
include mempool/production/nginx/server-common.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-services.conf;
|
||||
|
||||
proxy_cache markets;
|
||||
proxy_cache_valid 200 30s;
|
||||
|
||||
@@ -46,6 +46,7 @@ add_header Vary Cookie;
|
||||
# https://stackoverflow.com/questions/5238377/nginx-location-priority
|
||||
|
||||
# for exact / requests, redirect based on $lang
|
||||
# cache redirect for 10 minutes
|
||||
location = / {
|
||||
if ($lang != '') {
|
||||
return 302 $scheme://$host/$lang$uri;
|
||||
@@ -55,11 +56,17 @@ location = / {
|
||||
}
|
||||
|
||||
# used to rewrite resources from /<lang>/ to /en-US/
|
||||
# cache /resources/** for 1 week since they don't change often
|
||||
location ~ ^/[a-z][a-z]/resources/(.*) {
|
||||
try_files $uri /en-US/resources/$1 =404;
|
||||
expires 1w;
|
||||
}
|
||||
# used for cookie override
|
||||
# cache /<lang>/main.f40e91d908a068a2.js forever since they never change
|
||||
location ~ ^/([a-z][a-z])/(.+\..+\.(js|css)) {
|
||||
try_files $uri =404;
|
||||
expires 1y;
|
||||
}
|
||||
# cache everything else for 10 minutes
|
||||
location ~ ^/([a-z][a-z])$ {
|
||||
try_files $uri /$1/index.html /en-US/index.html =404;
|
||||
expires 10m;
|
||||
@@ -69,12 +76,18 @@ location ~ ^/([a-z][a-z])/ {
|
||||
expires 10m;
|
||||
}
|
||||
|
||||
# fallback to serving resources from en-US
|
||||
# cache /resources/** for 1 week since they don't change often
|
||||
location /resources {
|
||||
try_files $uri /en-US/$uri /en-US/index.html;
|
||||
expires 1w;
|
||||
}
|
||||
# fallback for all URLs i.e. /address/foo /tx/foo /block/000
|
||||
# cache /main.f40e91d908a068a2.js forever since they never change
|
||||
location ~* ^/.+\..+\.(js|css) {
|
||||
try_files /$lang/$uri /en-US/$uri =404;
|
||||
expires 1y;
|
||||
}
|
||||
# catch-all for all URLs i.e. /address/foo /tx/foo /block/000
|
||||
# cache 10 minutes since they change frequently
|
||||
location / {
|
||||
try_files /$lang/$uri $uri /en-US/$uri /en-US/index.html =404;
|
||||
expires 10m;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
include mempool/production/nginx/server-common.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-services.conf;
|
||||
include mempool/production/nginx/location-api.conf;
|
||||
include mempool/production/nginx/location-liquid-api.conf;
|
||||
include mempool/production/nginx/location-liquidtestnet-api.conf;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
include mempool/production/nginx/server-common.conf;
|
||||
include mempool/production/nginx/location-redirects.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors.conf;
|
||||
include mempool/production/nginx/location-api-v1-contributors-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations.conf;
|
||||
include mempool/production/nginx/location-api-v1-donations-images.conf;
|
||||
include mempool/production/nginx/location-api-v1-services.conf;
|
||||
include mempool/production/nginx/location-api.conf;
|
||||
include mempool/production/nginx/location-testnet-api.conf;
|
||||
include mempool/production/nginx/location-signet-api.conf;
|
||||
|
||||
Reference in New Issue
Block a user