mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 04:33:11 +03:00
chore(nginx): Rout rules have been split into and moved to another folder
Some checks failed
Deploy docs / deploy (push) Has been cancelled
Create and publish a Docker image / build-and-push-server (push) Has been cancelled
Create and publish a Docker image / build-and-push-chart (push) Has been cancelled
Create and publish a Docker image / build-and-push-CR (push) Has been cancelled
Some checks failed
Deploy docs / deploy (push) Has been cancelled
Create and publish a Docker image / build-and-push-server (push) Has been cancelled
Create and publish a Docker image / build-and-push-chart (push) Has been cancelled
Create and publish a Docker image / build-and-push-CR (push) Has been cancelled
This commit is contained in:
parent
f543d2336f
commit
907b614f25
8 changed files with 89 additions and 99 deletions
|
@ -1,2 +1,3 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
docs/
|
docs/
|
||||||
|
.gitignore
|
|
@ -5,9 +5,8 @@ services:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
- ./nginx/:/etc/nginx/
|
||||||
- ./CertSSL:/etc/nginx/ssl
|
- ./CertSSL:/etc/nginx/ssl
|
||||||
- ./robots.txt:/etc/nginx/robots.txt
|
|
||||||
- ./assets/logo.png:/etc/nginx/assets/logo.png
|
- ./assets/logo.png:/etc/nginx/assets/logo.png
|
||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- server
|
||||||
|
|
96
nginx.conf
96
nginx.conf
|
@ -1,96 +0,0 @@
|
||||||
events { }
|
|
||||||
|
|
||||||
http {
|
|
||||||
limit_req_zone $binary_remote_addr zone=kekkai:10m rate=10r/s;
|
|
||||||
# Change the number '10' to your own, to change the threshold number for rate limit
|
|
||||||
|
|
||||||
upstream server_backend {
|
|
||||||
server server:3000;
|
|
||||||
}
|
|
||||||
|
|
||||||
upstream chart_backend {
|
|
||||||
server chart:3030;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name localhost; # Your domain
|
|
||||||
|
|
||||||
limit_req zone=kekkai;
|
|
||||||
|
|
||||||
return 301 https://$host$request_uri$is_args$args;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name localhost; # Your domain
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
|
||||||
|
|
||||||
limit_req zone=kekkai;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
limit_req zone=kekkai burst=4;
|
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
proxy_pass http://server_backend;
|
|
||||||
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_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/getRate {
|
|
||||||
limit_req zone=kekkai burst=4;
|
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
proxy_pass http://server_backend;
|
|
||||||
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_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/metadata {
|
|
||||||
limit_req zone=kekkai burst=4;
|
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
proxy_pass http://server_backend;
|
|
||||||
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_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/getChart {
|
|
||||||
limit_req zone=kekkai burst=4;
|
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
proxy_pass http://chart_backend;
|
|
||||||
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_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /static/chart {
|
|
||||||
limit_req zone=kekkai burst=4;
|
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
proxy_pass http://chart_backend;
|
|
||||||
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_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /robots.txt {
|
|
||||||
alias /etc/nginx/robots.txt;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /favicon.ico {
|
|
||||||
alias /etc/nginx/assets/logo.png;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
2
nginx/.gitignore
vendored
Normal file
2
nginx/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ssl
|
||||||
|
assets
|
19
nginx/chart/nginx.conf
Normal file
19
nginx/chart/nginx.conf
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
location /api/getChart {
|
||||||
|
limit_req zone=kekkai burst=4;
|
||||||
|
|
||||||
|
proxy_pass http://chart:3030;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /static/chart {
|
||||||
|
limit_req zone=kekkai burst=4;
|
||||||
|
|
||||||
|
proxy_pass http://chart:3030;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
28
nginx/nginx.conf
Normal file
28
nginx/nginx.conf
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
events { }
|
||||||
|
|
||||||
|
http {
|
||||||
|
limit_req_zone $binary_remote_addr zone=kekkai:10m rate=10r/s;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost; # Your domain
|
||||||
|
|
||||||
|
limit_req zone=kekkai;
|
||||||
|
|
||||||
|
return 301 https://$host$request_uri$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
|
||||||
|
server_name localhost; # Your domain
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
||||||
|
|
||||||
|
limit_req zone=kekkai;
|
||||||
|
|
||||||
|
include chart/nginx.conf;
|
||||||
|
include server/nginx.conf;
|
||||||
|
}
|
||||||
|
}
|
37
nginx/server/nginx.conf
Normal file
37
nginx/server/nginx.conf
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
location / {
|
||||||
|
limit_req zone=kekkai burst=4;
|
||||||
|
|
||||||
|
proxy_pass http://server:3000;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/getRate/ {
|
||||||
|
limit_req zone=kekkai burst=4;
|
||||||
|
|
||||||
|
proxy_pass http://server:3000;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/metadata/ {
|
||||||
|
limit_req zone=kekkai burst=4;
|
||||||
|
|
||||||
|
proxy_pass http://server:3000;
|
||||||
|
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_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /robots.txt {
|
||||||
|
alias robots.txt;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /favicon.ico {
|
||||||
|
alias assets/logo.png;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue